Created by: gracewashere
Problem
In order for developers to customize views, they need to define templates in specific paths inside the application.
It can be difficult for developers to remember which paths they need to place the template files into, what the templates should be called, and which variables are available inside each of the views.
Solution
Add generators according to the documentation for copying views from administrate's source code into the appropriate location in the developer's code base.
Usage
generate views for all resources
rails generate administrate:views:index
# Generates app/views/administrate/application/index.html.erb
# Generates app/views/administrate/application/_table.html.erb
rails generate administrate:views:show
# Generates app/views/administrate/application/show.html.erb
rails generate administrate:views:edit
# Generates app/views/administrate/application/edit.html.erb
# Generates app/views/administrate/application/_form.html.erb
rails generate administrate:views:new
# Generates app/views/administrate/application/new.html.erb
# Generates app/views/administrate/application/_form.html.erb
rails generate administrate:views
# Generates all of the above
Generate views for a specific resource
rails generate administrate:views:index User
# Generates app/views/administrate/users/index.html.erb
# Generates app/views/administrate/users/_table.html.erb
rails generate administrate:views:show User
# Generates app/views/administrate/users/show.html.erb
rails generate administrate:views:edit User
# Generates app/views/administrate/users/edit.html.erb
# Generates app/views/administrate/users/_form.html.erb
rails generate administrate:views:new User
# Generates app/views/administrate/users/new.html.erb
# Generates app/views/administrate/users/_form.html.erb
rails generate administrate:views User
# Generates all of the above