Class: Admin::RolesController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::RolesController
- Defined in:
- app/controllers/admin/roles_controller.rb
Instance Method Summary collapse
- #activate ⇒ Object
- #add_right ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #duplicate ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #rights ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#activate ⇒ Object
71 72 73 |
# File 'app/controllers/admin/roles_controller.rb', line 71 def activate @role.activate end |
#add_right ⇒ Object
65 66 67 68 69 |
# File 'app/controllers/admin/roles_controller.rb', line 65 def add_right @role.update_attributes(params[:role]) @role.save return redirect_to([forgeos_core, :admin, @role]) end |
#create ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/admin/roles_controller.rb', line 29 def create if @role.save flash[:notice] = I18n.t('role.create.success').capitalize redirect_to [forgeos_core, :edit, :admin, @role] else flash[:error] = I18n.t('role.create.failed').capitalize render :action => "new" end end |
#destroy ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'app/controllers/admin/roles_controller.rb', line 48 def destroy if @role.destroy flash[:notice] = I18n.t('role.destroy.success').capitalize else flash[:error] = I18n.t('role.destroy.failed').capitalize end respond_to do |wants| wants.html do redirect_to([forgeos_core,:admin,:roles]) end wants.js end end |
#duplicate ⇒ Object
21 22 23 24 |
# File 'app/controllers/admin/roles_controller.rb', line 21 def duplicate @role = @role.clone render :action => 'new' end |
#edit ⇒ Object
26 27 |
# File 'app/controllers/admin/roles_controller.rb', line 26 def edit end |
#index ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/admin/roles_controller.rb', line 5 def index respond_to do |format| format.html # index.html.erb format.json do sort render :layout => false end end end |
#new ⇒ Object
18 19 |
# File 'app/controllers/admin/roles_controller.rb', line 18 def new end |
#rights ⇒ Object
62 63 |
# File 'app/controllers/admin/roles_controller.rb', line 62 def rights end |
#show ⇒ Object
15 16 |
# File 'app/controllers/admin/roles_controller.rb', line 15 def show end |
#update ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'app/controllers/admin/roles_controller.rb', line 39 def update if @role.update_attributes(params[:role]) flash[:notice] = I18n.t('role.update.success').capitalize else flash[:error] = I18n.t('role.update.failed').capitalize end render :action => "edit" end |