Posts

Add a new role to your site with devise

Montag, 04. April 2011, 01:06 Uhr | roberto@vasquez-angel.de |

Adding a new role (i.e. “Admin”) is easy:

$> rails generate devise Admin

Don’t forget to migrate:

$> rake db:migrate

Then you can check for the admin in your controllers:

class BackendController < ApplicationController
  before_filter :authenticate_admin!
end