Click isn't one of the REST states, so you will have to add that to your routes. In Rails 2.3, this looks like this:

map.resources :posts, :member => { :click => :get }

In Rails 3, you would do:

resources :posts do
  member do
    get 'click'
  end
end

Walter

On May 26, 2011, at 8:31 AM, John 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"}.

John

--
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 rubyonrails- [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 .

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