Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Bryan Jenkins
5,438 PointsAdding Social Features (Changes in Rails 4)
I'm looking to make the transition from mostly scaffold based rails apps to ones with custom controllers, polymorphic associations, and state machines.
I noticed that the Treebook tutorials do a great job of explaining all those aspects but they are dated by 2 years.
Am I going to have a hard time transitioning the knowledge I gain from those courses into Rails 4 and Ruby 2? I don't want to develop habits that don't apply to the new way of doing things in Rails.
2 Answers
David Moore
13,916 PointsTransitioning from 3 to 4? No, I don't think so. That said, if you do not plan to work on code written in older versions of Ruby or Rails you would probably be better off starting with the Odot app which is developed in Rails 4 with Rspec testing.
The big differences you will see are strong parameters used in the controller as opposed to attr_accessible in the model and hash rockets being replaced by the prettier trailing colon (not sure if I said that right, someone correct me if I butchered it).
As I have said before, I think it is important for anyone who is relying on Treehouse to provide all they need to know about Rails to adjust their expectations. Treehouse does a great job of getting you rolling (actually, I think there are better used as a step 2 or 3 in the learning process) but there is much more needed to really learn Rails. This is not a dig on Treehouse, I have not found any single resource that is a one stop shop. In fact, I think they are doing a pretty darn awesome job at providing a ton of info for the price of admission. Just be prepared to keep rolling once you finish up the courses here.
Bryan Jenkins
5,438 PointsThanks David Moore. I can make my way around a straight forward rails app, I'm having a difficult time grasping larger applications with polymorphic associations and multiple relations. If I can use the methodology taught in the Treebook tutorials, I think I can get my head around it. I'm just afraid that once I learn the old way to handle complex modeling, it will have changed completely when I work with Rails 4.
Thanks for your help. I think I'll start from the odot app and hopefully cross reference the materials taught in the Treebook app with the new way to handle it in Rails 4. Google will be in full use.