how can I add a new action to a controller?

Posted by Angela on Stack Overflow See other posts from Stack Overflow or by Angela
Published on 2010-12-27T07:39:44Z Indexed on 2010/12/27 10:53 UTC
Read the original article Hit count: 177

Filed under:
|
|

I used the following in routes to add a new action to my Email controller:

   map.resources :emails, :member => { :newfwd => :put}

The expected result was that newfwd_email_path(:id => 1) would generate the following urL: emails/1/newfwd

It does. But I get an error, it treats '1' as an action and 'newfwd' as an id. I want '1' to be interpreted as the id for emails, upon which the newfwd action acts.

I'm not sure what I'm doing wrong. (Note: I am using Rails 2.3.8)

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about routes