On 26 May 2011 13:31, John <[email protected]> wrote:
> I made a button using "<%= button_to "New", :action => "click" %>" and have
> a method in controller as:
>  def click
>  end
>                       In router file i had added resources as " resources:
> posts" .In app/view/posts/click.html.erb file holds simple hello message,but
> when i click on the button it says:
>
>                      No route matches {:controller=>"posts",
> :action=>"click"}.

resources: posts just gives you the standard routes.  If you want a
non-standard one you have to add it yourself.  See the Rails Guide on
Routing for more information.
You can type
rake routes
to find what routes are defined.  If you do that you will find that
posts/click is not there at the moment, so you get the error.

Colin

-- 
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