Class: Detour::FlaggableFlagsController
Instance Method Summary
collapse
#feature_name, #flag_noun, #flag_title, #flag_type, #flag_verb, #flaggable_type
Instance Method Details
#index ⇒ Object
8
9
10
|
# File 'app/controllers/detour/flaggable_flags_controller.rb', line 8
def index
@feature = Detour::Feature.find_by_name!(params[:feature_name])
end
|
#update ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/detour/flaggable_flags_controller.rb', line 12
def update
@feature = Detour::Feature.find_by_name!(params[:feature_name])
if @feature.update_attributes(params[:feature])
flash[:notice] = "Your #{flag_noun.pluralize} have been updated"
redirect_to send("#{flag_type}_flags_path", feature_name: params[:feature_name], flaggable_type: params[:flaggable_type])
else
render :index
end
end
|