I'm setting request.format = :mobile within an ApplicationController before_filter.
before_filter :some_filter
def some_filter
request.format = :mobile
end
I have this mapping in routes:
map.my_list '/my_list.:format', :controller => "of_no", :action => "significance"
When I do the following:
<%= link_to "My List", my_list_path %>
I get the following (ACTUAL below):
<a href="/my_list">My List</a> <!-- THIS IS THE PROBLEM -->
I want this to be (EXPECTED below):
<a href="/my_list.mobile">My List</a> <!-- THIS IS THE EXPECTED -->
However, if I do the following:
<%= link_to "My List", my_list_path(:format => "mobile") %>
Then I get the EXPECTED result, but doing this to every "link_to" is not a viable solution.
Any idea?
Thank you