relative path - Enforce trailing slash in Rails Routing -
adding trailing slash in links easy enough {:trailing_slash => true}, doesn't account if user types in non-slashed url. there way enforce trailing slashes via redirects in router?
get "/:controller/:id" => redirect{|params| "/#{params[:controller]}/#{params[:id]}/" }
the above leads circular loop.
why?
a relative link of "./subclass" on
/parent/1
is different than
/parent/1/
in config/application.rb file, add
config.action_controller.default_url_options = { :trailing_slash => true }
in application class