Rails 3, third beta release
Posted by Sandro Paganotti in
Ruby on Rails -
no comments
On the way to the first RC1 the core team relased today a new beta release due to the extraction of some features into plugins, let have a look to them in detail:
Rails Verification:
Rails verification bring into Rails some of the logic taken from the programming by contract paradigm; using this plugin you can define some constraint that need to be matched in order to call the requested action. This statement is implemented at class level as follow:
verify :params => "need_to_be_admin", :only => :update_post,
:redirect_to => { :action => "not_enough_privilegies" }
In this example a user is redirected to the ‘not_enough_privilegies’ action if he tries to access to the ‘update_post’ action withouth a parameter ‘need_to_be_admin’ setted. Note that, because they’re working only at controller-level, these prerequisites are not business rules. They do not examine the content of the session or the parameters.
Dynamic form:
This plugin only incapsulate some helpers methods that already belongs to Rails in previous versions of the framework; these methods refer to the creation of forms and the display of the model’s error messages.

