ruby on rails - Routing to static html page in /public -


how can route /foo display /public/foo.html in rails?

you can this:

add this, routes.rb file.

match '/foo', :to => redirect('/foo.html') 

update

in rails 4, should use "get", not "match":

get '/foo', :to => redirect('/foo.html') 

thanks grant birchmeier


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -