TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rails 5.0: Action Cable, API mode, and more

664 pointsby tenderlovealmost 9 years ago

29 comments

mhartlalmost 9 years ago
Looks like now&#x27;s a good time to mention that the <i>Ruby on Rails Tutorial</i> book has already been updated for Rails 5:<p><a href="http:&#x2F;&#x2F;railstutorial.org&#x2F;book" rel="nofollow">http:&#x2F;&#x2F;railstutorial.org&#x2F;book</a><p>Sales actually just launched on Tuesday (announcement here: <a href="https:&#x2F;&#x2F;news.learnenough.com&#x2F;rails-5-edition-of-rails-tutorial" rel="nofollow">https:&#x2F;&#x2F;news.learnenough.com&#x2F;rails-5-edition-of-rails-tutori...</a>), and you can pick up your copy of the new 4th edition here:<p><a href="http:&#x2F;&#x2F;railstutorial.org&#x2F;code&#x2F;launch" rel="nofollow">http:&#x2F;&#x2F;railstutorial.org&#x2F;code&#x2F;launch</a><p>That link includes a 20% launch discount, which expires tonight at midnight PDT.<p>As with previous versions, the new edition focuses on the core principles of web development, so there isn&#x27;t much Rails 5–specific material in the update, but I am planning standalone Learn Enough tutorials on things like Action Cable and Rails API (<a href="http:&#x2F;&#x2F;learnenough.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;learnenough.com&#x2F;</a>).
评论 #12012599 未加载
评论 #12014387 未加载
评论 #12017871 未加载
评论 #12012466 未加载
评论 #12013867 未加载
评论 #12014018 未加载
jbackusalmost 9 years ago
I feel bad for Sean Griffin. He spent over a year overhauling the internals of ActiveRecord to add this attributes API. His work dramatically improves coercion and type enforcement for ActiveRecord users. Seems weird for this to only get a non-descriptive bullet point in &quot;other highlights.&quot;<p>Here are the docs if anyone is interested: <a href="http:&#x2F;&#x2F;edgeapi.rubyonrails.org&#x2F;classes&#x2F;ActiveRecord&#x2F;Attributes&#x2F;ClassMethods.html#method-i-attribute" rel="nofollow">http:&#x2F;&#x2F;edgeapi.rubyonrails.org&#x2F;classes&#x2F;ActiveRecord&#x2F;Attribut...</a>
评论 #12012585 未加载
评论 #12013008 未加载
评论 #12012613 未加载
评论 #12016950 未加载
评论 #12035754 未加载
neyaalmost 9 years ago
I see a lot of pro-Erlang&#x2F;Phoenix pushing in here, which is (as a polite reminder) an announcement about the rails framework. Not to say that one shouldn&#x27;t, just that I think it&#x27;s deviating from the main topic in hand. Interestingly, I wanted to find out what&#x27;s the real reason behind these pushes towards Erlang&#x2F;Phoenix and I realised the discussion is mostly around how you can save a few bucks worth $20-50 by opting for a faster programming language.<p>Any framework can be tuned to do anything. Rails right now is the only truly comprehensive framework with tight integrations to Coffee, LESS, CSS, etc. As someone who is writing his own framework in Scala, I learned this the hard way after under-estimating how much of work is already done for you in Rails.<p>If you run a business, then all this small talk shouldn&#x27;t matter as much as how profitable you are. In the end, if your business failed because of your choice of framework (which usually reflects your philosophy), then you need to fix your business model and not the framework.<p>As a polite reminder, I&#x27;d like to link to an old comment of mine I made at the time of Rails 4.2:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8201244" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8201244</a><p>Have a great weekend everyone!
评论 #12014824 未加载
评论 #12014714 未加载
FooBarWidgetalmost 9 years ago
Passenger author here. Phusion is excited about the Rails 5.0 release! Rails is one of the most productive web frameworks out there, and 5.0 just makes it even better.<p>We have release various Passenger updates to ensure that Passenger plays well with Rails 5, Action Cable etc:<p><a href="https:&#x2F;&#x2F;blog.phusion.nl&#x2F;2016&#x2F;02&#x2F;18&#x2F;passenger-5-0-25&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.phusion.nl&#x2F;2016&#x2F;02&#x2F;18&#x2F;passenger-5-0-25&#x2F;</a><p><a href="https:&#x2F;&#x2F;www.phusionpassenger.com&#x2F;library&#x2F;config&#x2F;nginx&#x2F;action_cable_integration&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.phusionpassenger.com&#x2F;library&#x2F;config&#x2F;nginx&#x2F;action...</a><p>However we found a bug in Action Cable yesterday which may cause issues with app servers such as Passenger and Puma. Unfortunately the fix didn&#x27;t make it into 1.0. I recommend anybody who uses Action Cable to apply our patch locally for now: <a href="https:&#x2F;&#x2F;github.com&#x2F;rails&#x2F;rails&#x2F;pull&#x2F;25615" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rails&#x2F;rails&#x2F;pull&#x2F;25615</a>
katabasisalmost 9 years ago
I know that lots of other languages &#x2F; frameworks compete these days for the title of &quot;most-cutting-edge&quot;, but I love working with Rails. There&#x27;s a lot to be said for the &quot;stability without stagnation&quot; approach. I come from a design background, did not study computer science, and am usually working as a team of one. Rails lets me leverage very finite amounts of time and theoretical knowledge into working software that is elegant, testable, and comprehensible. It is an amazing piece of technology, and I&#x27;m happy to see it&#x27;s still going strong!
connorsheaalmost 9 years ago
I&#x27;ve been following along with Rails 5 for many months now and I&#x27;ve been tracking progress on updating GitLab in our issue tracker[1].<p>Feel free to look at the relevant merge requests and use them as guides to upgrade your own apps :) We&#x27;re still on 4.2.6 since we have a few gems we&#x27;re waiting on, but I hope to change that in a month or two!<p>Favorite features are probably the various performance improvements and underlying improvements to the framework, as well as quiet_assets being moved into sprockets-rails.<p>I also wanted to give a shoutout to BigBinary&#x27;s Rails 5 series, since it&#x27;s been great for finding out about new features[2].<p>[1]: <a href="https:&#x2F;&#x2F;gitlab.com&#x2F;gitlab-org&#x2F;gitlab-ce&#x2F;issues&#x2F;14286#note_4272270" rel="nofollow">https:&#x2F;&#x2F;gitlab.com&#x2F;gitlab-org&#x2F;gitlab-ce&#x2F;issues&#x2F;14286#note_42...</a> [2]: <a href="http:&#x2F;&#x2F;blog.bigbinary.com&#x2F;categories&#x2F;Rails-5&#x2F;" rel="nofollow">http:&#x2F;&#x2F;blog.bigbinary.com&#x2F;categories&#x2F;Rails-5&#x2F;</a>
bcardarellaalmost 9 years ago
We&#x27;ve moved all of our backend offerings from Rails to Elixir&#x2F;Phoenix. Despite some questioning the value of anything below 100ms response times there is a lot of data backing up the idea that Elixir&#x2F;Phoenix can lead to a more maintainable and more economical solution. I spoke about this recently at RailsConf: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=OxhTQdcieQE" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=OxhTQdcieQE</a><p>Don&#x27;t get me wrong, I think Rails is an amazing technology but it doesn&#x27;t fit the use cases and demands our clients have today.
评论 #12012497 未加载
评论 #12012604 未加载
评论 #12012424 未加载
评论 #12019006 未加载
评论 #12013028 未加载
评论 #12012496 未加载
drchiualmost 9 years ago
I personally really love using Rails. It&#x27;s been very productive for me over the past several years I&#x27;ve been able to make a living off of this.<p>I see a lot of comments here about Elixir&#x2F;Phoenix. Is the performance gain really that big? I currently serve 2-3 mil requests on Rails per day on around $200 worth of servers with at least one database call per request. In defense of Rails, there are so many libraries out there already built I can get an app up and running fairly quickly. I really think it&#x27;s a matter whether the tool fits the bill.
评论 #12013024 未加载
评论 #12013788 未加载
pawsalmost 9 years ago
Congrats to the contributors and thanks for the hard work pushing this out!<p>Looking forward to Heroku working out of the box[1] and quiet assets moved to core[2]<p>[1] <a href="https:&#x2F;&#x2F;blog.heroku.com&#x2F;container_ready_rails_5" rel="nofollow">https:&#x2F;&#x2F;blog.heroku.com&#x2F;container_ready_rails_5</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;rails&#x2F;sprockets-rails&#x2F;pull&#x2F;355" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rails&#x2F;sprockets-rails&#x2F;pull&#x2F;355</a>
vassyalmost 9 years ago
By looking at the comments you&#x27;d assume a new version of Phoenix got released.
评论 #12013027 未加载
评论 #12013292 未加载
themgtalmost 9 years ago
Looks like a solid and and relatively straightforward upgrade from Rails 4.2. It&#x27;s hard not to feel Rails has become a bit of a slow-moving behemoth though, with this release four years after 4.0. I&#x27;ve still got a couple clients using 3.2 from 2012 and things aren&#x27;t <i>that</i> different.<p>Smart money at this point seems like a significant portion of the Rails community could begin moving to Elixir&#x2F;Phoenix over the coming years. The advantages from a language&#x2F;VM level just look impossible for Ruby to overcome, along with a blub effect kicking in.
评论 #12012517 未加载
评论 #12012330 未加载
评论 #12012348 未加载
评论 #12012890 未加载
评论 #12013207 未加载
评论 #12012402 未加载
jesalgalmost 9 years ago
This has been long awaited:<p><pre><code> Post.where(&#x27;id = 1&#x27;).or(Post.where(&#x27;id = 2&#x27;))</code></pre>
评论 #12012302 未加载
评论 #12012422 未加载
评论 #12012682 未加载
评论 #12014995 未加载
mfoalmost 9 years ago
To my mind the big news is Turbolink, A simple tech to build SPA with the following roots : - the robustness &amp; ecosystem of the rails server side (great testing stack &amp; battle tested backend) - the lightweight approach of rails&#x2F;javascript, which is opting out of jquery : meaning that SPAs won&#x27;t have to include jQuery and the whole JS world (client side speed will be greatly enhanced) - the overall simplicity (no huge javascript stack pilling angular, react, redux, flux, webpack etc...).<p>That&#x27;s rad.
jblakealmost 9 years ago
Odd they didn&#x27;t mention performance improvements in the blog post. From my understanding, there have been some massive gains (of which, some commits date back to early &#x27;15!) One of them which has been killing me, is that model schemas were not preloaded on app boot, which led to the first few dozen requests (depending on how many workers you have on Puma) perform 100+ sql queries and add over 1s to response times. Not only were they not preloaded, but they were not cached across ActiveRecord::Base.connection&#x27;s<p>Good work rails team!
bratschealmost 9 years ago
This is pretty cool. I&#x27;ve kind of moved on to Elixir and Phoenix for my web stuff these days, but it&#x27;s still nice to see Rails going strong.
评论 #12012306 未加载
评论 #12017265 未加载
cutleralmost 9 years ago
Concurrency aside, why is Elixir preferred over Ruby when it doesn&#x27;t even have a native array implementation? No, lists and tuples are no substitute nor are maps with numeric keys as Jose has suggested. If you want an array in Elixir your only option is Erlang&#x27;s implementation which ain&#x27;t pretty - <a href="http:&#x2F;&#x2F;erlang.org&#x2F;doc&#x2F;man&#x2F;array.html" rel="nofollow">http:&#x2F;&#x2F;erlang.org&#x2F;doc&#x2F;man&#x2F;array.html</a>. When I raised this issue in the mailing list and on IRC the response was invariably a definsive &quot;I&#x27;ve never needed arrays&quot;, &quot;We use tuples for most things in Elixir&quot; or &quot;Array performance characteristics are difficult to optimise in a functional language such as Elixir&quot;. I just find this disappointing.
评论 #12013145 未加载
评论 #12013180 未加载
评论 #12013125 未加载
评论 #12013224 未加载
评论 #12013220 未加载
评论 #12013141 未加载
评论 #12013352 未加载
评论 #12013103 未加载
fantasticsidalmost 9 years ago
I actually don&#x27;t like rails&#x27; convention over configuration school of thoughts. It makes everything implicit. For any large rails app it&#x27;s difficult to reason about how things are working, unless you learn all the conventions by heart (by the way, these conventions don&#x27;t seem to be documented well)
评论 #12014147 未加载
Fuffidishalmost 9 years ago
Nice! The Turbolinks 5 presentation was really impressive
hartatoralmost 9 years ago
The big things seems to be websockets with Rails cable. I&#x27;ve just skim through the documentation but seems solid. Anyone has a strong opinion on this?
desireco42almost 9 years ago
A long awaited release is finally here, Yoohoo!<p>Now, let the job of upgrading begins.<p>Also, I love how everyone found a feature they&#x27;ve been waiting for and celebrating it. Rails, always bring joy (pain comes in few years ;) )
juandazapataalmost 9 years ago
Thanks to the community for all the hard work on this release.
nathan_longalmost 9 years ago
I&#x27;m happy to see the new way to render views outside the request cycle: <a href="http:&#x2F;&#x2F;blog.bigbinary.com&#x2F;2016&#x2F;01&#x2F;08&#x2F;rendering-views-outside-of-controllers-in-rails-5.html" rel="nofollow">http:&#x2F;&#x2F;blog.bigbinary.com&#x2F;2016&#x2F;01&#x2F;08&#x2F;rendering-views-outside...</a><p>This will be great for, eg, creating reports or receipts in background jobs.
评论 #12018409 未加载
justinzollarsalmost 9 years ago
I wish I had API mode 4 years ago
评论 #12012821 未加载
elsurudoalmost 9 years ago
Is anyone aware of a site that the memory footprints of default Rails apps? I know that this may not be the greatest indication of the memory footprint in an actual running app, but I feel it&#x27;d still be interesting data. It&#x27;d have the be segmented by ruby version, of course.
评论 #12016329 未加载
fnalmost 9 years ago
Finally! Congrats to all the contributors!
jblakealmost 9 years ago
Anyone else&#x27;s bundle update spazzing out on resolving dependencies? Guess I&#x27;ll have to wait until other third party gems get the Rails 5 memo.
xjlin0almost 9 years ago
I love Action Cable!
albashaalmost 9 years ago
I am very jealous as a Django developer. They decided to keep Channels as a third-party package after all, maintained by a single guy :(
评论 #12013186 未加载
评论 #12017445 未加载
评论 #12013426 未加载
评论 #12013395 未加载
iamleppertalmost 9 years ago
All my new development these days centers around node + browserify&#x2F;webpack with a react frontend, or just plain javascript for small projects.<p>WebSockets would have been a cool addition four years ago. There is little compelling case for new development. Sorry to be so harsh.
评论 #12014640 未加载