ãµã¤ãã®æ§ç¯ãä½åã®è²©å£²ãããã°ã®æ稿ããã®ä»ã«ããã¾ãã¾ãªæ©è½ãããã¾ãã ãã°ã¤ã³ ãµã¤ããã¯ãããã éå ¬éãµã¤ã ãã®ãµã¤ãã¯ç¾å¨ãã©ã¤ãã¼ãè¨å®ã«ãªã£ã¦ãã¾ãã
ãµã¤ãã®æ§ç¯ãä½åã®è²©å£²ãããã°ã®æ稿ããã®ä»ã«ããã¾ãã¾ãªæ©è½ãããã¾ãã ãã°ã¤ã³ ãµã¤ããã¯ãããã éå ¬éãµã¤ã ãã®ãµã¤ãã¯ç¾å¨ãã©ã¤ãã¼ãè¨å®ã«ãªã£ã¦ãã¾ãã
ååã®ãã¤ã°ã¬ã¼ã·ã§ã³ããã®ç¶ãã§ãä»åã¯SinatraããActiveRecord 3ã使ã£ã¦CRUDæä½ããã¦ã¿ããã¨ãã£ã¦ããããããCRUDæä½ã«ã¤ãã¦ã¯Railsã§ä½¿ãå ´åã¨Sinatraã¨ã§ã¯ã»ã¨ãã©éãã¯ãªãã¨æããããåååæ§ãActiveRecord 3èªä½ã®ä½¿ãæ¹ã¯ãã®è¨äºãã¨ã¦ãããããããã£ãã®ã§å ¨é¢çã«åèã«ãã¦ããã ã¢ãã« ActiveRecordã使ã£ã¦DBã®CRUDæä½ãããå ´åãActiveRecord::Baseãæ´¾çããã1ã¤ã®ã¯ã©ã¹ãDBã®1ãã¼ãã«ã«å¯¾å¿ãããã®ã¯ã©ã¹ã®å±æ§ããã¼ãã«ã®åã«ã©ã ã«å¯¾å¿ãããã¨ã«ãªãããã®ã¯ã©ã¹ã®ãã¨ãä¸è¬çã«ãã¢ãã«ãã¨å¼ã¶ãRailsã§ã¯ãRailsã¢ããªãçæãã段éã§MVCå¥ã«ãã©ã«ããç¨æããã¦ããã®ã§ãmodelãã©ã«ãã«ãã®ActiveRecord::Baseæ´¾çã¯ã©ã¹ãä½ããã ãã©ãSinatraã§ã¯
以åSinatraããDataMapperã使ãè¨äºãæ¸ãããã©ãä»åã¯Sinatraã®O/Rãããã¼é¨åã«ActiveRecord 3ã使ã£ã¦ã¿ããActiveRecord 3èªä½ã®ä½¿ãæ¹ã«ã¤ãã¦ã¯ããã®è¨äºããããããããããã£ãã Sinatraã¢ããªã«å¿ è¦ãªãã¡ã¤ã«ãç¨æãã ã¾ãã¯ãSinatraã¢ããªãå®è¡ããã®ã«å¿ è¦ãªæä½éã®ãã¡ã¤ã«ç¾¤(Gemfile, config.ru, app.rb)ãä½æãããä»åã¯åºæ¬çã«ãã¹ã¦Bundlerçµç±ã§æä½ããã®ã§ãã·ã¹ãã å´ã«Bundlerã®gemãã¤ã³ã¹ãã¼ã«ããã¦ããå¿ è¦ãããã Gemfile ä»å使ç¨ããgemã¯ãããªæããã¨ããããSinatraã§ActiveRecord 3ã使ãå ´åã¯activerecordã¨sinatra-activerecordã¨sqlite3ãå¿ è¦ã§ãä»å使ã£ããã¼ã¸ã§ã³ã¯ããããã3.0.6ã0.
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}