It took nearly two years. After multiple test versions, Ruby On Rails 3.0 was officially released. Over 1600 developers participated in the development. With the joint efforts of everyone, Ruby On Rails 3.0 was "faster, stronger, and more beautiful". I believe the new version will not disappoint you.
The Ruby On Rails 3.0 official version has changed a lot, so it is very difficult to pick out outstanding features. Here we will introduce some major changes in the new version.
Ruby on Rails Architecture
For more information about Rails, visit: Ruby On Rails development tutorial.
◆New activity record Query Engine
- Code example:
- Users = User. where (: name => "david"). limit (20)
- Users. where ("age> 29 ")
-
- # SELECT * FROM users
- # WHERE name = "david" AND age> 29
- # Order by name
- # LIMIT 20
- Users. order (: name). each {| user | puts user. name}
◆New Action Mailer component
- Code example:
- Class Notifier <ActionMailer: Base
- Default: from =>
- "Highrise "
-
- Def new_project (digest, project, person)
- @ Digest, @ project, @ person = digest, project, person
-
- Attachments0000'digestance'] = digest. to_pdf
- Attachmentspolic'logo.jpg '] = File. read (project. logo_path)
-
- Mail (
- : Subject => "Your digest for # {project. name }",
- : To => person. email_address_with_name
- ) Do | format |
- Format. text {render: text => "Something texty "}
- Format.html {render: text => "SomethingTexty"}
- End
- End
- End
◆XSS protection is enabled by default.
◆Question about farewell to character encoding
◆Internal Reconstruction
◆Comprehensive documentation
◆ Support for MySQL2 gem
◆ Fixed the automatic loading problem.
Installation Method: gem install rails -- version 3.0.0.
Download Ruby On Rails 3.0: http://rubyonrails.org/download
Reading
Ruby on Rails is based on the MVC Model-View-Controller) design mode. From Ajax applications in the view, access requests and feedback in the Controller, to database encapsulation models, Rails provides you with a pure Ruby development environment. When publishing a website, you only need a database and a network server.