Hi Rodrigo, I don't think this is a common enough case that we need to have it in the generator. You're mostly only going to set the root once. Editing this by hand is imo just fine.
On Monday, December 21, 2015 at 5:02:22 PM UTC+1, Rodrigo Rosenfeld Rosas wrote: > > I was watching DHH's demo on ActionCable and something took my attention > more than it should in my opinion. > > One of the first things we do for every application is to generate a > root action and then manually edit routes.rb: > > 1 - rails g controller welcome index > 2 - change routes.rb from "get 'welcome/index'" to "root to: > 'welcome#index'" > > Maybe it would be a good idea to introduce some kind of flag in the > generator to get this done automatically. It may be a tiny change but it > makes a difference when you are demoing any Rails application from > scratch. > > Maybe something like: > > rails g controller welcome index:root help > > Which would generate some routes like: > > root to: 'welcome#index' > get 'welcome/help' > > If another root action already exists or if two actions are flagged as > root actions the generator command would raise an error. > > Is this something you have considered before? > > Best, > Rodrigo. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.
