ruby on rails - Passing instance with button_to -
pretty new ruby on rails , reached first road block can't seem figure out after researching.
on view, generating button each instance of "newbie"
i send 'zendeskid' of each controller "giveticket"
so far, have:
<div class="container"> <div class="containertop"></div> <p><%= newby.name %></p> <%= button_to "give ticket!", {:controller => "giveticket",:action => "new", :newby.zendeskid => @newby.zendeskid} %> </div> </div> <% end %>
however, getting "undefined method `zendeskid' :newby:symbol"
could please point me in right direction - bit stuck @ moment! thank in advance.
to send parameters controller action can send action name.
named routing more preferable , recommended use in rails
. can write as,.
<%= button_to "give ticket!", new_giveticket_path(zendeskid: newby.zendeskid) %>
Comments
Post a Comment