How to we pass in additional params besides the ID
#we want to pass in additional params as well <%= link_to "bleh", like_path(answer), :add_param=>2 , :remote=>"true" ,:method=>:post %>
You can pass parameters in the path function as part of the url. Something like:
<%= link_to "bleh", like_path(:answer_id => 123, :add_param => 2), :remote=> true , :method=> :post %> # would result in something like # yourapp.com/like/aswer/3?add_param=2
But I think you need to move away from the purely resource based path helper in this case. Check the documentation for ideas.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With