I have a static page that has several links. These links route to the pro_show action in my Posts controller.
def pro_show
@posts = Post.where(:code => @code)
end
I want to pass in the value of :code through my routes. :code is a string.
Right now my routes look like the below route. How do I assign a string value to @code ? I DO NOT need to change the :code of any Post. I need to use the @code variable to sort my Post records as you can see in my action.
This is what I am doing right now=>
<td><%= link_to "This Post", pro_show_path(@code => 87889) %></td>
Am I doing this correctly? Does the value of @code need to be in quotes? Thanks