I recently dived into Rails and am having trouble with the link_to
method.
I’d like to pass some parameters to the action being called and am not
sure
how to do it. Essentially, I want to hyperlink a total count of bugs
queried from the database to a method that will return the bug numbers
when
clicked on. I have a method, bug_total, that returns the total number
to
display in the view. I have another method, total_bugs, that will
return
the bugzilla url with all the bugid’s for that particular build when
clicked.
Below is what I have in my view. I’d like to pass the
:action=>“total_bugs”
some parameters(build_number, developer_name, product_name) based on the
current build. I’ve tried many ways and haven’t been successfull, yet.
Any
help is greatly appreciated. Thanks!
<%
for build in @bugDashboard
%>
<%= link_to build.bug_total, {:controller => “dashboard”,
:action => “total_bugs”} %>
…