{"id":275862,"date":"2016-03-10T15:39:03","date_gmt":"2016-03-10T12:39:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=275862"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=275862","title":{"rendered":"Rails 5.0. \u041c\u043e\u0436\u043d\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0435\u0437\u0434"},"content":{"rendered":"<p>       \u041d\u0430 16 \u043c\u0430\u0440\u0442\u0430 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u043b\u0438\u0437 Rails 5.0, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0438 \u0432\u043a\u0443\u0441\u043d\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0435\u043b\u044c\u0441\u043e\u0432 (\u043a\u0440\u043e\u043c\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043b\u043e\u0433\u043e\u0442\u0438\u043f\u0430 \u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0438\u0445 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u044f \u0438\u043c\u0435\u044e \u0432 \u0432\u0438\u0434\u0443).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f52\/c36\/a59\/f52c36a5909a9d619c671c031c501563.png\" alt=\"image\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u043b\u0438\u0437 Rails 5.0 \u0431\u044b\u043b \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u0432\u0435\u0441\u043d\u0443 2015 \u0433\u043e\u0434\u0430 \u0438 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0441\u0434\u0432\u0438\u0433\u0430\u043b\u0441\u044f, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u0441 23 \u0444\u0435\u0432\u0440\u0430\u043b\u044f \u043d\u0430 <a href=\"http:\/\/weblog.rubyonrails.org\/2016\/2\/27\/Rails-5-0-beta3\/\">16 \u043c\u0430\u0440\u0442\u0430 2016<\/a>. \u0422\u043e \u0435\u0441\u0442\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0440\u043e\u043a\u043e\u0432. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, Rails 5.0 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 beta3 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 <a href=\"http:\/\/basecamp.com\/\">Basecamp<\/a><\/p>\n<h5>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h5>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e ruby 2.2.2+<\/li>\n<li>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Webrick \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 Puma \u043d\u0430 16 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/li>\n<li>\u0412\u0441\u0435 rake \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u043d\u0430 rails, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<code> rails db:migrate<br \/>   <\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<h5>\u0418 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430<\/h5>\n<p>  <\/p>\n<h5>Turbolinks 3<\/h5>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f turbolinks \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0441\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0447\u0435\u0440\u0435\u0437 ajax \u0431\u0435\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u0439\u043b\u0430\u043c css,js \u0438 \u0442.\u0434. \u041d\u043e\u0432\u0430\u044f \u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u0447\u0435\u0440\u0435\u0437 partials), \u043f\u0440\u0438\u0447\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. <\/p>\n<h5>Action Cable<\/h5>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Websockets, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 single page application \u0431\u0435\u0437 \u0442\u0430\u043d\u0446\u0435\u0432 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c. \u041a\u0430\u043d\u0430\u043b\u044b, \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0438 \u043a \u043d\u0438\u043c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p>  \u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0432\u0438\u0434\u0435\u043e <a href=\"http:\/\/hectorperezarenas.com\/2015\/12\/26\/rails-5-tutorial-how-to-create-a-chat-with-action-cable\/\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b<\/a> \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Action Cable \u2013 \u0432\u0435\u0431 \u0447\u0430\u0442 \u043d\u0430 Rails \u0431\u0435\u0437 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<h5>API \u0440\u0435\u0436\u0438\u043c<\/h5>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 HTML \u0438 JS \u0447\u0430\u0441\u0442\u0435\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2013 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043b\u0435\u0433\u0447\u0435.<br \/>  <code>rails new backend --api<br \/>  <\/code><br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0440\u0430\u0437\u0443 c\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON, \u0430 \u043d\u0435 HTML<\/p>\n<h5>Sprockets 4<\/h5>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0444\u0430\u0439\u043b app\/assets\/config\/manifest.js \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<br \/>  <code>\/\/ JS and CSS bundles<br \/>  \/\/<br \/>  \/\/= link_directory ..\/javascripts .js<br \/>  \/\/= link_directory ..\/stylesheets .css<\/p>\n<p>  \/\/ Images and fonts so that views can link to them<br \/>  \/\/<br \/>  \/\/= link_tree ..\/fonts<br \/>  \/\/= link_tree ..\/images<br \/>  <\/code><br \/>  \u0415\u0449\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442 (js \u0438\u043b\u0438 yml), \u0441 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u043b\u0438\u0437\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<h5>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0430\u0445\u0430\u0440\u0430<\/h5>\n<p>  \u0415\u0433\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043d\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0438 \u043c\u0435\u043b\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0433\u043b\u044f\u043d\u0443\u043b\u0438\u0441\u044c \u0432\u043e\u0442 \u044d\u0442\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e:  <\/p>\n<ul>\n<li><code>params<\/code> \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0445\u044d\u0448, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442<\/li>\n<li>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a: <code>User.where(users[:name].eq(\u2018bob\u2019).or(users[:age].lt(25)))<\/code><\/li>\n<li>\u041c\u0435\u043b\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b Integer#positive? \u0438 Integer#negative?<\/li>\n<li>\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435\u043c belongs_to \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f, \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 exception<\/li>\n<\/ul>\n<h5>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h5>\n<p>  \u041e\u0431\u0435\u0449\u0430\u044e\u0442 20-30% \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041a\u0430\u043a \u044f \u043f\u043e\u043d\u044f\u043b, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0437\u0430 \u0441\u0447\u0435\u0442 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a (\u0438 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435).<\/p>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 beta<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">git clone --depth 1 http:\/\/github.com\/rails\/rails cd rails bundle railties\/exe\/rails new --edge appname cd appname bundle bundle exec rails s <\/code><\/pre>\n<h5>\u041f\u043e\u0447\u0438\u0442\u0430\u0442\u044c<\/h5>\n<p>  <a href=\"http:\/\/blog.michelada.io\/whats-new-in-rails-5\">http:\/\/blog.michelada.io\/whats-new-in-rails-5<\/a><br \/>  <a href=\"https:\/\/medium.com\/evil-martians\/the-rails-5-post-9c76dbac8fc#.9p0fpry5o\">https:\/\/medium.com\/evil-martians\/the-rails-5-post-9c76dbac8fc#.9p0fpry5o<\/a><br \/>  <a href=\"http:\/\/alltutsfree.com\/?s=rails\">\u0421\u0430\u043c\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0432\u0438\u0434\u0435\u043e \u043f\u043e\u0434\u043a\u0430\u0441\u0442 \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445<\/a> (\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438)               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/278969\/\"> https:\/\/habrahabr.ru\/post\/278969\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0430 16 \u043c\u0430\u0440\u0442\u0430 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u043b\u0438\u0437 Rails 5.0, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0438 \u0432\u043a\u0443\u0441\u043d\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0435\u043b\u044c\u0441\u043e\u0432 (\u043a\u0440\u043e\u043c\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043b\u043e\u0433\u043e\u0442\u0438\u043f\u0430 \u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0438\u0445 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u044f \u0438\u043c\u0435\u044e \u0432 \u0432\u0438\u0434\u0443).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f52\/c36\/a59\/f52c36a5909a9d619c671c031c501563.png\" alt=\"image\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-275862","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=275862"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275862\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}