app/controllers/admin/roles_controller.rb in the_role-1.7.0 vs app/controllers/admin/roles_controller.rb in the_role-2.0.0
- old
+ new
@@ -1,17 +1,17 @@
class Admin::RolesController < ApplicationController
- include TheRole::Requires
- layout 'the_role'
+ include TheRoleController
+ layout TheRole.config.layout.to_s
before_filter :login_required
before_filter :role_required
- before_filter :role_find, :only => [:edit, :update, :destroy]
- before_filter :owner_required, :only => [:edit, :update, :destroy]
+ before_filter :role_find, only: [:edit, :update, :destroy]
+ before_filter :owner_required, only: [:edit, :update, :destroy]
def index
- @roles = Role.all :order => 'created_at ASC'
+ @roles = Role.all.order('created_at ASC')
end
def new
@role = Role.new
end
@@ -46,10 +46,13 @@
protected
def role_find
@role = Role.find params[:id]
- @ownership_checking_object = @role
+
+ # TheRole: You should define OWNER CHECK OBJECT
+ # When editable object was found
+ @owner_check_object = @role
end
def redirect_to_edit
redirect_to edit_admin_role_path @role
end
\ No newline at end of file