Skip to content

Instantly share code, notes, and snippets.

@paradigm314
Created September 7, 2016 20:26
Show Gist options
  • Save paradigm314/5a0fc40c26594865ccc991c8f43daea9 to your computer and use it in GitHub Desktop.
Save paradigm314/5a0fc40c26594865ccc991c8f43daea9 to your computer and use it in GitHub Desktop.
Rails 4 generate scaffolding in admin namespace
# Run In Console
rails g model Foo
rails g scaffold_controller Admin::Foo --model-name=Foo
# Generates
# db/migrate/20160907201951_create_foo.rb
# app/models/foo.rb
# app/controllers/admin/foo_controller.rb
# app/views/admin/foo
# app/views/admin/foo/index.html.erb
# app/views/admin/foo/edit.html.erb
# app/views/admin/foo/show.html.erb
# app/views/admin/foo/new.html.erb
# app/views/admin/foo/_form.html.erb
# Plus all the respctive tests and fixtures for your test suite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment