2014-08-01ãã1ã¶æéã®è¨äºä¸è¦§
åãè¦ãããæ¯ãã§ãããå¿ææ°ã¯ä¸æãç¶ããè¦è¦ãè´è¦ãå è¦ãã主è¦ãªäºæã¯ã¾ãã§æ©è½ããªãèªãã¨è§¦è¦ã«å ¨ç¥çµãéä¸ãã¦ããç®ã«ã¯è¦ããªãç¼åã®æ§ç¸ããå¿ æ»ã«ãªã£ã¦æ¨¡ç´¢ããåºãæ触ã¨æãããæ触çµé¨ã«ãªãæ触ã«ã触è¦ããããããã¤ä½åº¦ãã®â¦
cakeã®recursiveé¢é£ã§ã¯æ¯åè¦ãããããã®ã§ãä»åå°ãããã£ããã¨ãã¡ã¢ã ããããã£ããã¨ã¯é¡ã®éããé¢é£å ã®ãã®å ã®ãã¼ãã«ãã¼ã¿åå¾ã ãã£ãããªã®ã§recursiveã«ã¤ãã¦ã軽ãã¾ã¨ããâ»è¿½è¨â» çµå±ãã¾ãå©ä¾¿æ§ãè¯ããªãã®ã§ãjoinsãªãã·ã§ã³â¦
Controllerã®editããã³updateã¢ã¯ã·ã§ã³ãªã©ã§ãã¼ã¿ã®ã¢ãããã¼ããè¡ã£ãéãå¤æ´ããããã¼ã¿ã®åå¾ãããããã¨ãããã¾ãããã ã¨ããããã§åå¾æ³ãã¡ã¢ã£ã¦ããã¾ãã ç°å¢ Rails 4.0 Ruby 2.1 å¤æ´é¢é£ã®ã¡ã½ãã群 Ruby On Rails ããã«ã¼ãè¡éâ¦
ãã¹ããã¼ã¿ãããå æ¸ã«å ¥ãã¦ãã¾ã£ã¦å¾æãããã¨ãããã¾ãããã ALTER TABLE table_name AUTO_INCREMENT = 1; ããã ãã§ãªã¼ãã¤ã³ã¯ãªã¡ã³ããåæååºæ¥ã¾ãï¼ç´ æ´ãããï¼ï¼
å½åã£ã¦å¤§å¤ãªä½æ¥ã ã¨æãã¾ããæ¥ã ã®ã³ã¼ãã£ã³ã°ã§ä»ããªãããããªãå¤æ°åãããåä¾ã®ååã¾ã§ãè³é«ã«é»æãæµãããããªç´ æ´ãããååã¯ä¸ã æãã¤ãã¾ããã ãã®ããã°ã®ã¿ã¤ãã«ã§ãããããã°ã©ã ã¯ãç¨ãããã¸ãã¯ã®é¸æã§æ±ºã¾ããã¨ããã®â¦
é¨ã®æ¹¿æ°ã¨ç èã®ç ãããæãã«ãããã³ã°ãã¦ã大ããçç±ããªãæå·çãªæ°æã¡ã«ãªãã¾ããæ´ãã¦ããæ¥ã«ã¯ç èãªãã¦ã¨æããã ãã©ãé¨ã®æ¥ã¯ã©ãããããã帰ãéã«ãã±ã¼ã£ã¨ãããããªãã ã¨ããããã§ã¹ããã¹ã¤ããã®ã¹ã¢ã¼ãã³ã¬ã¤ãã¼ãã«ã¼èâ¦