Saturday, February 12, 2011

[Rails] Re: link_to a action in the controlles is not called

On Feb 12, 10:25 pm, Lorenzo Brito Morales <lorenzo.br...@gmail.com>
wrote:
> i have  a link where it has to call a method defin in todoscontroller
> named say_when but show is called
>       <td><%= link_to 'Say when', todo,  :action => :say_when ,
> :remote => true %></td>
>

The problem is that (by definition) this links to the show action for
a todo (the second argument to link_to specifies what the link should
point at) If you want it to link to something else, then, after you've
added it to routes.rb, you can write something like link_to 'Say
when', say_when_todo(todo), ...

Fred

--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate