= NycDevshop
Nyc devshop is an internal gem for the company NYC Devshop created by Yanik Jayaram which contains custom generators for the purpose of auto-generating commonly used assets, configs, gems, controllers, routes, models and views
= Usage
In its current state, this gem should be used once and only once upon creation of your application.
couple of things to note:
- the controllers will be set up assuming you are using rails4.
- the strong parameters will not be auto-filled in the controllers. You must do this yourself
-
Add the following line to your gemfile:
gem 'nyc_devshop'
-
Run the following command:
$ bundle install
-
Run the following command:
$ rails g devshop_gems
-
Run the following command, passing the app name (ex, 'MyApp') as an argument:
$ rails g devshop MyApp
-
Create and migrate any models for which you want CRUD actions and views to be created in your admin panel (with the exception of an Administrator model, which is automatically created for you via the generators).
e.g.
$ rails g model User first_name last_name email
$ rake db:migrate
-
Run the following command, passing the names of the migrated models for which you want CRUD actions and views to be be created in your admin panel (formatting must be singular, lowercase, and space separated (NO COMMAS)):
e.g.
$ rails g devshop_admin administrator user
-
Results
- Start your rails server and you should see a dummy public index page
- Go to http://localhost:3000/admin to see an admin login page. Login credentials are
login: 'admin@admin.com'
password: '123'
You should see your resources with associated crud actions.