README.rdoc in inherited_resources-1.0.6 vs README.rdoc in inherited_resources-1.1.pre

- old
+ new

@@ -8,24 +8,28 @@ code by following fat models and skinny controllers convention. There is a screencast made by Fabio Akita about its features: http://akitaonrails.com/2009/09/01/screencast-real-thin-restful-controllers-with-inherited-resources -This Inherited Resources branch is tested and compatible with Rails 2.3.x. +== Rails 3 -== Installation +Inherited Resources master branch is now supports Rails 3 and is backward incompatible. -Inherited Resources is available as gem on Gemcutter, so just run the following: +You can install it as: - sudo gem install inherited_resources --version=1.0.3 + sudo gem install inherited_resources --version=1.1.pre -If you want it as plugin, just do: +If you want to use the Rails 2.3.x version, you should install: - script/plugin install git://github.com/josevalim/inherited_resources.git + sudo gem install inherited_resources --version=1.0 -=== HasScope +Or checkout from the v1.0 branch: + http://github.com/josevalim/inherited_resources/tree/v1.0 + +== HasScope + Since Inherited Resources 1.0, has_scope is not part of its core anymore. However, if you are using has_scope in your application, Inherited Resources will handle all the required hooks automatically. has_scope gem is available at: @@ -34,11 +38,11 @@ And can be installed as: sudo gem install has_scope -=== Responders +== Responders Since Inherited Resources 1.0, responders are not part of its core anymore, but is set as Inherited Resources dependency and it's used by default by InheritedResources controllers. Be sure to check the documentation to see how it will change your application: @@ -206,9 +210,27 @@ provided. So you can do: class ProjectsController < InheritedResources::Base def destroy destroy!{ root_url } + end + end + +If you simply want to change the flash message for a particular action, you can +pass the message to the parent action using the keys :notice and :alert (as you +would with flash): + + class ProjectsController < InheritedResources::Base + def create + create!(:notice => "Dude! Nice job creating that project.") + end + end + +You can still pass the block to change the redirect, as mentioned above: + + class ProjectsController < InheritedResources::Base + def create + create!(:notice => "Dude! Nice job creating that project.") { root_url } end end Now let's suppose that before create a project you have to do something special but you don't want to create a before filter for it: