ruby on rails - Heroku: Redirect / to /features -
how can have make auto redirecting every user goes mysite.com/ mysite.com/features?
thanks
set root route direct folks there (these rails 3 routes):
in config/routes.rb
root "content#features"
in app/controllers/contents_controller.rb
class contentscontroller < applicationcontroller def features end end
that won't redirect, however. that, you'll need this: in config/routes.rb
match "features" => "contents#features", :as => "features" root "content#index"
in app/controllers/contents_controller.rb
class contentscontroller < applicationcontroller def index redirect_to features_url end def features end end
Comments
Post a Comment