Re:Michael Hartl announces the Rails Tutorial Vanguard
by rjett on Friday June 11, 2010 @12:38AM
(#1422820)
One question for Michael or any other rails developers out there: railstutorial.org teaches rails using Rails 2.3.x, but it looks like at least the first batch of screencasts you're putting out will be about Rails 3. How much of what I just learned by going through Rails Tutorial is going to be obsolete in Rails 3 and if I have already started to develop an app using the techniques discussed in the tutorial, should I stop while I'm not far in and start over with Rails 3 or should I keep on with 2.3.6 and try to transition everything further down the road?
[ Parent
| on HN ]
Re:Michael Hartl announces the Rails Tutorial Vanguard
by aarongough on Friday June 11, 2010 @01:04AM
(#1422870)
From what I've seen most of the basic knowledge involved in creating a Rails 2.X app translates well for Rails 3. The basic application structure and the way of thinking about the layout of the application remains largely unchanged.
Some highlight differences difference being:
# ActiveRecord query syntax
2.X: User.all(:conditions => {:name => "aaron"}, :limit => 1)
3.X: User.where(:name => "aaron").limit(1)
# ActionMailer API now closely matches the ActionController API
2.X:
class Notifier
def user_notification(user)
recipients user.email
subject "test subject"
from "[email protected]"
body :user => user
end
end
3.X:
class Notifier
default :from => "[email protected]"
def user_notification(user)
@user = user
end
end
In Rails 3 Gem dependencies are managed using Bundler, which means that you have to explicitly declare all of the gems your application uses, even fundamental things like Rails and Rack. Calls to config.gem need to be removed, and added to a Gemfile instead.There are quite a few more API changes than what I have listed here, routes in particular will change greatly for complex applications. The full details are here: http://guides.rails.info/3_0_release_notes.html
Re:Michael Hartl announces the Rails Tutorial Vanguard
by philwelch on Friday June 11, 2010 @06:04AM
(#1423366)
I'm going along with the tutorial myself, except I'm actually doing it in Rails 3 and researching the differences on my own as they crop up.
So far, the tutorial actually seems fairly accurate. Differences so far: the tutorial has you use RSpec 1 for testing, but RSpec 2 (prerelease) is required for Rails 3. Also, routing is completely different in Rails 3, which shows up early on (when you create a new static page without autogenerating it) and then later in the routing section. Then there's the minor matter of using "rails generate" and "rails server" instead of "script/server" and "script/generate".
Re:Michael Hartl announces the Rails Tutorial Vanguard
by fdschoeneman on Friday June 11, 2010 @07:36AM
(#1423515)
I'd say not very much. I've been through the tutorial in both 2.3.5 and 3.0.0.beta and think the improvements in the latter justify developing in it. Probably a much more useful question to ask yourself is whether or not the plugins you'll need for your application have been tested, and work in Rails 3.
Re:Michael Hartl announces the Rails Tutorial Vanguard
by mhartl on Friday June 11, 2010 @05:31PM
(#1424816)
Most of your Rails 2.3 knowledge will still be good, but I would suggest developing your new app using Rails 3 if possible. I'll be working on the Rails 3 version of the tutorial over the next few weeks; keep your eyes peeled for an announcement when it's ready.
Re:Michael Hartl announces the Rails Tutorial Vanguard
by aarongough on Friday June 11, 2010 @01:19AM
(#1422891)
Also: I would keep going with the tutorial. It's always good to have the experience of transitioning between versions, and you probably won't appreciate Rails 3 as much if you haven't used 2.X! :-p