In your routes.rb:

map.resources :document, :collection => { :publish => :post }

and add your

def publish
  ..
end

in your controller.



On Nov 13, 12:30 pm, explainer <[email protected]> wrote:
> I used the scaffold option to generate a RESTful set of routes to a
> Document model.  All works as described.  Now, I wish to extend the
> controller to add a 'publish' action on DocumentController and add a
> 'publish' route to mimic what the generated 'create' action does.  How
> do I specify this in the routes.rb file?  BTW, I need to keep the
> create action as generated.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to