Controller generator improvement

34 views
Skip to first unread message

Anthon Mur

unread,
Apr 13, 2015, 4:10:18 PM4/13/15
to rubyonra...@googlegroups.com

Hello! I noticed that when i do rails g controller admin/infobar index edit update show i get that in my routes.rb:

  namespace :admin do
  get 'infobar/index'
  end

  namespace :admin do
  get 'infobar/edit'
  end

  namespace :admin do
  get 'infobar/update'
  end

  namespace :admin do
  get 'infobar/show'
  end

It is kinda annoying and badly indented.

Is it possible for it to maybe receive option --rest and produce that instead?  I would be glad to start working on that.

namespace :admin do 
  resource :infobar, only: [:index, :edit, :update, :show]
end
Reply all
Reply to author
Forward
0 new messages