Ruby on Rails 2.1.x Tutorialããã£ã¦ã¿ãã®æ¬ç®¡çCGIã«èªè¨¼æ©è½ãã¤ãã¦ã¿ããåèã¨ãããµã¤ãã¯ä»¥ä¸ã®ã¨ããã AVNet Labs » Blog Archive » Restful Authentication with rails 2 ã¦ããããï¼restful_authentication ã§ã¡ã¼ã«èªè¨¼ããã SHOWZINE » restful_authenticationã«ããã¦ã¼ã¶èªè¨¼ãå®è£ ZDNet Japan Blogï¼ãã¨ã§èªãRailsã®ã¹ã¹ã¡ï¼restful_authentication idesaku blogï¼restful_authenticationã触ã£ã¦ã¿ã kaeruspoonï¼restful_authenticationã使ã£ã¦ã¿ã ä¸è¨ã®ã¨ã³ããªã¼ç¾¤ãèªãéããRailsã®æ¨æºèªè¨¼ãã©ã°ã¤ã³ã¨ãã¦ä½¿ãããã®ã¯restfu
ãµã¼ãã¹çµäºã®ãç¥ãã ãã¤ãYahoo! JAPANã®ãµã¼ãã¹ããå©ç¨ããã ãèª ã«ãããã¨ããããã¾ãã ã客æ§ãã¢ã¯ã»ã¹ããããµã¼ãã¹ã¯æ¬æ¥ã¾ã§ã«ãµã¼ãã¹ãçµäºãããã¾ããã ä»å¾ã¨ãYahoo! JAPANã®ãµã¼ãã¹ããæ顧ãã ããã¾ãããããããããé¡ããããã¾ãã
ååããã®ç¶ããç¾ç¶ã®Todoã§ã¯ããã°ã¤ã³ããã¦ã¼ã¶ã¼ã¯å ±éã®Todoãå©ç¨ããä»æ§ã«ãªã£ã¦ãã¾ã£ã¦ããããããã¦ã¼ã¶ã¼å¥ã®Todoã«å¤æ´ããããrestful_authenticationã¯ããã®ã¦ã¼ã¶ã¼ãèªè¨¼ãããç¶æ ãã©ããããã§ãã¯ãã¦ããã®ã¦ã¼ã¶ã¼ã誰ã§ããããcurrent_userã§ç¢ºèªã§ããããã«ãã¦ããã¦ããããã¨ã¯Todoãã¦ã¼ã¶ã¼å¥ã«ç®¡çã§ããããã«å¯¾å¿ããã°è¯ãããã ã¦ã¼ã¶ã¼å¥ã®ç®¡ç ã¾ãæãã¤ããã®ããã¢ãã«ã«has_manyã¨belongs_toãè¨å®ãããã¨ã # ---------- app/models/user.rb ---------- require 'digest/sha1' class User < ActiveRecord::Base has_many :todos ...ï¼ä¸ç¥ï¼... # ---------- app/models/to
restful_authenticationã--statefulãªãã·ã§ã³ã§å©ç¨ããã¨ã2ã¤ã®state_machineãç¨æããã¦ãããã¨ã«æ°ä»ããä¸ã¤ã¯ã以åããå©ç¨ãã¦ããRailsã®ãã©ã°ã¤ã³acts_as_state_machineãã§ãããä¸ã¤ãgemã§ã¤ã³ã¹ãã¼ã«ããaasmãaasmã£ã¦acts_as_state_machineã®é æåã ããªï¼ã¨æããªãããããã©ã«ãã§ã¯acts_as_state_machineã®è¨å®ã«ãªã£ã¦ããããacts_as_...ã身è¿ã«æããã®ã§ãaasmã®æ¹ã¯ä»ã¾ã§ç¡è¦ãã¦ããã ã¨ããããã¤ã³ã¹ãã¼ã«ããacts_as_state_machineã®æ´æ°æ¥æãè¦ã¦ã¿ãã¨2006-11-13ã¨ç¸å½å¤ã...ã1å¹´å以ä¸æ´æ°ããã¦ããªããã¨ã«ãªããï¼ã§ããç¹ã«ä¸ä¾¿ã¯æããªãã®ã ãã©ãï¼ä¸æ¹ãaasmã®ãã¼ã¸ãè¦ã¦ã¿ãã¨ãä»ãæ´»çºã«æ´æ°ããã¦ããã
restful_authentication ãã©ã°ã¤ã³ã®ã¡ã¢ãæ¤è¨¼ã¯ Rails 2.0.2 ã§è¡ã£ã¦ãã¾ãã ãã©ã°ã¤ã³ã«ã¤ã㦠RESTful ãªã¦ã¼ã¶èªè¨¼ãè¡ãäºãã§ãã¾ãã é常ã®ã»ãã·ã§ã³ãç¨ããèªè¨¼ããã¼ã·ãã¯èªè¨¼ã Cookie ã«ããèªè¨¼ãå©ç¨ã§ãã¾ããç¹ã« Cookie ãç¨ããèªè¨¼ã¯ããã©ã¦ã¶ãéããå ´åã§ãæå¹æéå ãªãæå¹ã«ãªãã¾ãï¼è¨å®æå¹æï¼ã ã¤ã³ã¹ãã¼ã« ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ãã¾ããRails 1.2.6 以éã§ãªãã¨åä½ããªãã®ã§æ³¨æãã¦ä¸ããã ã¾ãã authenticated_system.rb 㯠RAILS_ROOT/lib 以ä¸ã«å±éããã¾ãã ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication/追è¨
Railsã§ã¦ã¼ã¶èªè¨¼ã¨ããã°acts_as_authenticatedã ã¨æã£ã¦ããã®ã§ãããä»ã¯ããrestful_authenticationã¨ãããã¤ãåºã¦ãã¦ããããã§ãããã£ããåãã?ãã¢ã³ããä½ãã®ã¯ãªãã¨ãããªããã°ãã¨ãããããä»éçºä¸ã®ããããã¼ã¯ã¼ãã§ä½¿ã£ã¦ã¿ããã¨ã«ããã ã¾ãã¯ã¤ã³ã¹ãã¼ã«ã ./script/plugin source http://svn.techno-weenie.net/projects/plugins ./script/plugin install restful_authentication
æè¿ãrestful_authenticationã§è©¦è¡é¯èª¤ãã¦ãã¦æãããã¨ãrestful_authenticationã¯ã¦ã¼ã¶ã¼èªè¨¼ã«é¢ããå¿ è¦æå°éã®æ©è½ãæä¾ãã¦ãããããå®éã«éç¨ã§ããã¬ãã«ã«ä»ä¸ããã«ã¯ãè¦ç¹ãæ¼ãããç確ãªä¿®æ£ãå¿ è¦ã«ãªããã¦ã¼ã¶ã¼èªè¨¼ã®scaffoldçãªä½ç½®ä»ãã ããã¨ã çæãããã½ã¼ã¹ã³ã¼ãã¯ã¨ã¦ãç°¡æ½ã«ã¾ã¨ãããã¦ãã¦ãèªã¿æããããããããèªå好ã¿ã®ãã°ã¤ã³ã«ä¿®æ£ãããã¨ããã¨ãå®ã«ãããããªæ段ããããã©ã®ãããªä»çµã¿ã«ãããæ¬å½ã«è¿·ã£ã¦ãã¾ãã ä¾ãã°ã以åã®æ¥è¨ã§è©¦ãããã¹ã¯ã¼ãå¿ãã«å¯¾å¿ããæ¹æ³ããä»æ¯ãè¿ã£ã¦ã¿ãã°ææªã®ä¾ã ...ãã¢ã¯ãã£ãã¼ã·ã§ã³ã¨ãã¹ã¯ã¼ãå¿ãã®å¦çãæ··åãã¦ããããä¿®æ£ã®æé ãã»ãã¥ãªãã£çã«ä¸éå端ãå®è£ ã®ä»æ¹ããã£ããã®restful_authenticationã®RESTfulãªã«ã¼ã«ãç¡è¦ãã¦ããããã¯
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}