Class: AclsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AclsController
- Defined in:
- app/controllers/acls_controller.rb
Instance Method Summary collapse
Methods included from Zena::App
Instance Method Details
#create ⇒ Object
32 33 34 |
# File 'app/controllers/acls_controller.rb', line 32 def create @acl = secure(Acl) {Acl.create(acl_attributes)} end |
#destroy ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'app/controllers/acls_controller.rb', line 51 def destroy @acl.destroy respond_to do |format| format.html do if @acl.errors.empty? redirect_to :action => 'index' else render :action => 'edit' end end format.js do render(:partial => 'form') unless @acl.errors.empty? end format.xml { head :ok } end end |
#edit ⇒ Object
25 26 27 28 29 30 |
# File 'app/controllers/acls_controller.rb', line 25 def edit respond_to do |format| format.html format.js { render :partial => 'form' } end end |
#index ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/acls_controller.rb', line 7 def index secure(Acl) do @acls = Acl.paginate(:all, :order => 'action ASC, priority DESC, name ASC', :per_page => 20, :page => params[:page]) end @acl = Acl.new respond_to do |format| format.html # index.html.erb end end |
#show ⇒ Object
18 19 20 21 22 23 |
# File 'app/controllers/acls_controller.rb', line 18 def show respond_to do |format| format.html { render :file => admin_layout, :layout => false } format.js end end |
#update ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/acls_controller.rb', line 36 def update @acl.update_attributes(acl_attributes) respond_to do |format| format.html do if @acl.errors.empty? redirect_to :action => 'show' else render :action => 'edit' end end format.js end end |