On 26 May 2011 13:40, Colin Law <[email protected]> wrote:
> 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.

I have just realised that the OP here is John Shelfer who has already
been advised to study that guide in order to understand routing.
John, assuming that you did study that guide, please ask for
clarification of which bits you did not understand.  It will be better
to get a good understanding rather than just have those here help you
out each time you have a trivial problem.

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