20150828

one more time with RoR

Today I'm interesting again for testing some of the RoR gems that I was reading and researching a long time ago, but combined all together.

  • rails_admin
  • devise
  • cancan
  • papertrail
Just to become a nice and easy start up app within a few seconds.

First I added the necessary gems to the Gemfile:

As I was using openshift, I had to get rid of the pg (not used, I'm using mysql || sqlite3).

Then:

rails g rails_admin:install


(mounting admin as /admin, the default option)
Then for devise:
rails generate devise:install
rails g devise:views
rails g devise User

For CanCan:
rails g cancan:ability


And for PaperTrail:
rails generate paper_trail:install --with-changes --with-associations

After that, only last to add the ":username" to the User model

rails g migration AddUsernameToUser username:string

Then the usual
bundle exec rake db:migrate

And for the groups, if needed:
rails g model Role name:string
rails g migration addRoleIdToUser role:references
rake db:migrate

And the base is quite OK
Publicar un comentario