Please Sign In No account? Create new user.
Please Sign In No account? Create new user.
èªçæ¥(timeãªãã¸ã§ã¯ã)ããå¹´é½¢ãæ±ãããã¨ã class Time def to_age now = Time.now.strftime("%Y%m%d").to_i birthday = self.strftime("%Y%m%d").to_i (now - birthday) / 10000 end end ã¨ãããmethodãä½ã£ã¦ãã㨠require 'time' t = Time.parse('1981/9/26') p t.to_age #=> 23 ã¨ç°¡åã«æ±ããããï¼åã©ã£ãã§åç´ã«ç¾å¨ã®20050922ã¿ãããªæ¥ä»ããèªçæ¥ã®19810926ãå¼ãã¦10000ã§å²ãã ãã§æ±ããããããã£ã¦ã®è¦ããããã ãã©ã©ãã§è¦ãã®ãå¿ããã®ã§ã¡ã¢ã
Ruby on Railsã«ã¯è¯ãããããã¥ã¼ããªã¢ã«ããã£ã¦ãæåã®ä¸æ©ã¯è¸ã¿åºããããããã«ãªã£ã¦ãã¾ãããããããã¥ã¼ããªã¢ã«ãã²ã¨ã¨ããèªãã§ãscaffoldã¹ã²ã¼ã¨ãããã¨ã¯ããã£ãã®ã ãã©ã次ã«ä½ããããè¯ããããããªãã¨ãã人ãå¤ãããã§ããããããçè ããã®ä¸äººã§ããã 次ã«ä½ãããã°ãããã¨ããã¨ãä¸çªè¯ãã®ã¯ãã¯ãèªåã§å®éã«ä½ãã¢ããªã±ã¼ã·ã§ã³ãä½ã£ã¦ã¿ããã¨ã§ãã ã¨ããããã§ãRailsåå¿è ã®çè ããRailsã®åå¼·ãã¦ããWikiã¯ãã¼ã³ããä½ã£ã¦ã¿ãã®ã§ããã®éç¨ãæ¸ãã¦è¦ããã¨ã«ãã¾ãããä½ãã®åèã«ãªãã°å¹¸ãã§ãã Wikiã¯ãã¼ã³ãé¸ãã ã®ã¯ãè¯ãç¥ããã¦ããã¢ããªã±ã¼ã·ã§ã³ã§ãããã¨ã¨ãæ©è½ãçµãã° Rails ã®ç·´ç¿ã«ã¯ã¡ããã©è¯ããããã®è¦æ¨¡ã ã¨æãããããã§ãã (注: Wikiã¯ãã¼ã³ã§å¤§å¤ãªã®ã¯ãWikiè¨æ³ã®ãã¼ãµã¨HTMLã«å¤æ
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}