Class: Adm::BaseController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Adm::BaseController
show all
- Defined in:
- app/controllers/adm/base_controller.rb
Constant Summary
collapse
{}
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
10
11
12
13
14
15
16
|
# File 'app/controllers/adm/base_controller.rb', line 10
def self. =nil
if
self..merge!
else
self.
end
end
|
Instance Method Details
#current_ability ⇒ Object
29
30
31
32
33
34
|
# File 'app/controllers/adm/base_controller.rb', line 29
def current_ability
controller_name_segments = params[:controller].split('/')
controller_name_segments.pop
controller_namespace = controller_name_segments.join('/').camelize
@current_ability ||= Ability.new(current_user, { namespace: controller_namespace })
end
|
#update ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/adm/base_controller.rb', line 18
def update
update! do |format|
if resource.errors.empty?
format.json { respond_with_bip(resource) }
else
format.html { render action: "edit" }
format.json { respond_with_bip(resource) }
end
end
end
|