Hi all. Been wondering about the possibilities of adding a new syntax for defining a root action in config/routes.rb
.
I like how resources :users
will set up the seven default paths (get #index
, get #show/:id
, post #create
, etc), and wonder if we could do something similar with a symbol syntax for the root
method?
Don’t know how others use their homepage, but I often find myself creating a WelcomeController with only an index action.
root "welcome#index"
If others deem it useful, it could be cool to replicate some of the syntax for resources
, defaulting to the index action when used.
root :welcome # => "welcome#index"