Class: Comable::Admin::NavigationsController
Instance Method Summary
collapse
#current_ability, #respond_to_export_with
Instance Method Details
#create ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 25
def create
@navigation = Comable::Navigation.new(navigation_params)
if @navigation.save
redirect_to comable.admin_navigation_path(@navigation), notice: Comable.t('successful')
else
render :new
end
end
|
#destroy ⇒ Object
43
44
45
46
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 43
def destroy
@navigation.destroy
redirect_to comable.admin_navigations_path, notice: Comable.t('successful')
end
|
#edit ⇒ Object
22
23
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 22
def edit
end
|
#index ⇒ Object
8
9
10
11
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 8
def index
@q = Comable::Navigation.ransack(params[:q])
@navigations = @q.result.accessible_by(current_ability).by_newest
end
|
#new ⇒ Object
18
19
20
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 18
def new
@navigation.navigation_items.build
end
|
#search_linkable_ids ⇒ Object
48
49
50
51
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 48
def search_linkable_ids
@linkable_id_options = Comable::NavigationItem.linkable_id_options(params[:linkable_type])
render layout: false
end
|
#show ⇒ Object
13
14
15
16
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 13
def show
edit
render :edit
end
|
#update ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'app/controllers/comable/admin/navigations_controller.rb', line 34
def update
@navigation.attributes = navigation_params
if @navigation.save
redirect_to comable.admin_navigation_path(@navigation), notice: Comable.t('successful')
else
render :edit
end
end
|