Reputation: 3669
I am thinking about learning the Rails way, and want to focus on Rails 3.
In Rails, when looking at code snippets and recipes that do not clearly mark what versions the code works on, how do I figure out what version the code works on without doing a full deploy? For example, setting up a database and running the code to see if it works in version XYZ.
Also, after I know what version the code base is from, how do I know if the code can be updated to work in Rails 3, or not?
Upvotes: 2
Views: 87
Reputation: 20184
If the documentation is any good, it will state what version of Rails it is for. The second link you provided mentions Rails 2.3 but makes no mention of Rails 3 anywhere, so I assume that it is written for Rails 2.x.
The Rails 3.0 release notes are a good resource for seeing what was deprecated in Rails 3.0. It goes over most of the major changes from previous versions of Rails.
There are lots of good resources for learning Rails 3 if that is what you are after. See my answer to this question for example: https://stackoverflow.com/questions/4234624/ruby-on-rails-version-3-tutorials-and-guides/4234642#4234642
Honestly, if you don't know Rails already, you will have a tough time determining what is Rails 3 vs Rails 2.x specific. I think it is a better idea just to dive into Rails 3 specific tutorials and resources for a while. When you know a little more it will be easier to recognize something from an older version of Rails and know how to do it the "Rails 3 Way".
Upvotes: 2