How can I route /foo to display /public/foo.html in Rails?
/foo
/public/foo.html
You can do this:
Add this, into your routes.rb file.
match '/foo', :to => redirect('/foo.html')
Update
In Rails 4, it should use "get", not "match":
get '/foo', :to => redirect('/foo.html')
thanks Grant Birchmeier
2.1m questions
2.1m answers
60 comments
57.0k users