What are the differences betweeen Rails 2.x and Rails 3
Answers were Sorted based on User's Feedback
Answer / dayanthan
(1) Introduction of bundler (New way to manage your gem
dependencies)
* (2) Gemfile and Gemfile.lock (Where all your gem
dependencies lies, instead of environment.rb)
* (3) A new .rb file in config/ folder, named as
application.rb (Which has everything that previously
environment.rb had)
* (4) Change in SQL Structure: Model.where(:activated => true)
* (5) All the mailer script will now be in app/mailers
folder, earlier we kept inside app/models.
* (6) Rails3-UJS support. for links and forms to work as
AJAX, instead of writing complex lines of code, we write
:remote => true
* (7) HTML 5 support.
* (8) Changes in the model based validation syntax:
validates :name, :presence => true
* (9) Ability to install
windows/ruby/jruby/development/production specific gems to
Gemfile.
group :production do
gem 'will_paginate'
end
| Is This Answer Correct ? | 22 Yes | 2 No |
Answer / biswaranjan
some functionality changers..
ex- in rail2.x
<%= link_to_remote ‘Show’, :url => post %>
ex in rail3.x
<%= link_to ‘Show’, post, :remote => true %>
etc..
| Is This Answer Correct ? | 21 Yes | 3 No |
Answer / padmavathy
The main differnce is code simplicity... In rails2 we should write the routes using map and each... In rails3 we dont need to write map and all.
For example:
Rails 2:
map.resoucers :users do |user|
user.resource :profile
end
Rails 3:
resources :users do
resource :profile
end
Like wise in active record also have some differences in rails 2 using find(:all) instead in rails 3 we use where etc..
Then terminal you have to write script for cmd instead rails 3 using rails cmd...
Rails 2:
<%=link_to_remote "login", post, :method=>:delete%>
Rails 3:
<%=link_to "login",new_post_path%>
i have noticed some points only have some more differences... Refer it... Those are all main things...
| Is This Answer Correct ? | 6 Yes | 1 No |
Do you know the role of garbage collection in ruby on rails?
Explain me what are the limits of ruby on rails?
What I have to do to view my project always on browser?
Explain testing in rails.
hi am b,tech 2011 passedout now am learnig ROR technology may i knw what is the feature of this one and what is the salary ranges to this i heard there is a less salaries to this technology give me valuable suggestions
what the difference between static scaffolding and Dynamic scaffolding?
What is the directory structure of rails?
Explain Get and post method?
Tell me what is orm (object-relationship-model) in rails?
What is the difference between symbol and string?
write a program to show the usage of sql in the database file?
Mention the types of variables available in Ruby Class?