top | item 25366052

(no title)

xionon | 5 years ago

For what it’s worth, the 2->3 update was by far the most consequential; they merged in Merb, rewrote how routes and controllers worked, and completely flipped expectations on how JS and views should work.

Rails 3->6 has had far fewer major user-facing architectural changes, and consisted mostly of new tools and APIs. A lot of stuff they added used to be handled by gems - password hashing, attachments, background jobs, caching, etc. all got rolled into the core framework.

Another comment mentioned https://guides.rubyonrails.org, which is good. I would focus on the new routing style, REST controllers, forms, and strong params; once you wrap your head around those, the rest will probably fall into place, or could be ignored completely.

discuss

order

sethhochberg|5 years ago

I genuinely think someone from the 2.x days could read a "how to migrate to Rails 3" guide, skim some release notes for each of the subsequent major releases, and be generally up to speed. I've been working with Rails almost continuously since the 3.x days, and if you ignore some of the more library-like additions like ActiveStorage or Credentials, things are structurally extremely similar between 3.2 and 6.0. The biggest differences to a casual reader would probably be Ruby syntax itself developing from Ruby 1.9 forwards to this point. Things were quite different in the 1.8.x days.

Models live in the same spot. Controllers live in the same spot. Your classes generally still inherit from the same stuff, albeit with some additions to the tree like for ApplicationRecord in places where you might previously have inherited directly from ActiveRecord::Base.

The stability is one of my favorite parts of Rails. Its still modern and very usable, but I don't need to relearn it all the time.

taf2|5 years ago

IMO it really has not changed much even from the 1.x days it’s just a bit more polished with AR having where syntax now instead of only find and better solutions for organizing code that isn’t strictly model/view/controller. But if i opened a rails 6 or rails 1, it’d be pretty easy to find my way around...

Avoid too many after hooks and before filters(er actions) and the code will be easier to follow and maintain