Hard coding codes in Rails
Say I have this:
<%= link_to "My Big Link", page_path(:id => 4) %>
And on my page. rb I want to show urls by their permalink, so I use the standard:
def to_param
"#{id}-#{title.parameterize}"
end
Now, when I click "My Big Link", it returns me to the correct page, but the URL in the address bar does not display the desired permalink. Instead, it just shows the standard:
wwww.mysite.com/pages/4
Is it because I hardcoded the id in page_path? It also does not work if I use direct html, for example ..
<a href="/pages/4">My Big Link</a>
I would appreciate it if someone could test the same behavior and let me know if this is intended or not. I need the ability to hard code: id specify exact pages ...