The rails way of making links in your view is to use link_to
. Passing it an object will link to that object's id
. How can I use my object's match_id
instead of id
with link_to
?
You can override the to_param
method in your model to return the value of match_id
to have link_to
and other rails helpers automatically use that value when generating urls.