Rails 5.0.0 ·¢²¼ÁË¡£
Rails ÊÇÒ»¸öÓÃÓÚ¿ª·¢Êý¾Ý¿âÇý¶¯µÄÍøÂçÓ¦ÓóÌÐòµÄÍêÕû¿ò¼Ü¡£Rails»ùÓÚMVC£¨Ä£ÐÍ- ÊÓͼ- ¿ØÖÆÆ÷£©Éè¼ÆÄ£Ê½¡£´ÓÊÓͼÖеÄAjaxÓ¦Ó㬵½¿ØÖÆÆ÷ÖеķÃÎÊÇëÇóºÍ·´À¡£¬µ½·â×°Êý¾Ý¿âµÄÄ£ÐÍ£¬Rails ΪÄãÌṩһ¸ö´¿RubyµÄ¿ª·¢»·¾³¡£·¢²¼ÍøÕ¾Ê±£¬ÄãÖ»ÐèÒªÒ»¸öÊý¾Ý¿âºÍÒ»¸öÍøÂç·þÎñÆ÷¼´¿É¡£
Ö÷Òª¸üÐÂÄÚÈÝ£º
Action Cable
Action CableÊÇRails´¦ÀíWebSocketµÄȫпò¼Ü¡£ÕâÊÇÒ»¸öÍêÈ«¼¯³ÉµÄÁ¬½Ó¹ÜÀí½â¾ö·½°¸£¬·þÎñÆ÷¶Ë´¦ÀíµÄͨµÀ²ãºÍ¿Í»§¶Ë½»»¥µÄJavaScript²ã¡£Ëü·Ç³£ÈÝÒ×ʹÓ㬲¢Ê¹¹¦ÄܳäÂúÉè¼Æ¸Ð£¬ÈçÁÄÌ죬֪ͨºÍ Presence ¶¼±äµÃÈÝÒ׺ܶࡣ
API mode
Èç¹ûÄúʹÓÃrails new backend --api£¬´´½¨Ò»¸öеÄRailsÓ¦ÓóÌÐò£¬Äã»áµÃµ½Ò»¸ö¾«¼òµÄskeletonºÍÅäÖ᣼ÙÉèÄã»áʹÓÃJSON£¬²»ÊÇHTML¡£Ä¬ÈÏÇé¿öÏ£¬API mode Ö»ÊÇÒÀÀµÓÚÓÚÄ£ÐÍÀàµÄ#to_json# calls £¬µ«ÊÇÄã¿ÉÒÔʹÓÃJBuilder£¬ Active Model Serializers£¬»ò¿´¿´ÐÂJSONAPI::Resources projectÀ´ÕÒµ½¸üÏȽøµÄ½â¾ö·½°¸¡£
ÆäËû¸ßÁÁ
One Rails Command instead of the split-brain setup between rake and rails, so now it¡¯s bin/rails db:migrate instead of bin/rake db:migrate (herding by Kasper Timm Hansen).
New Attributes API by Sean Griffin.
The test runner now reports failures inline, so you don¡¯t have to complete the suite to see what went wrong.
ApplicationRecord has been born as a default parent class of all models created by the generators.
ActiveRecord::Relation#in_batches makes it much easier to deal with record work in batches at a time to lessen memory overloads.
Post.where(¡®id = 1¡¯).or(Post.where(¡®id = 2¡¯)) gives you exactly what you¡¯d think!
No more accidentally halting Active Record callbacks because the last statement is false. Now you throw(:abort) explicitly!
Èí¼þÏêÇ飺http://weblog.rubyonrails.org/2016/6/30/Rails-5-0-final/#yay
ÏÂÔØµØÖ·£ºhttp://rubyonrails.org/
À´×Ô:¿ªÔ´ÖйúÉçÇø

