Class: GreenFlag::Admin::FeaturesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- GreenFlag::Admin::FeaturesController
- Defined in:
- app/controllers/green_flag/admin/features_controller.rb
Instance Method Summary collapse
Instance Method Details
#current_visitor_status ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/green_flag/admin/features_controller.rb', line 27 def current_visitor_status @feature = GreenFlag::Feature.find(params[:id]) fd = GreenFlag::FeatureDecision.for_feature(@feature.id).where(site_visitor_id: current_site_visitor.id).first render :json => { status: status_text(fd) } end |
#destroy ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/green_flag/admin/features_controller.rb', line 15 def destroy @feature = GreenFlag::Feature.where(id: params[:id]).first if @feature.present? destroy_feature else flash[:error] = "The feature could not be found." end redirect_to action: :index end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/green_flag/admin/features_controller.rb', line 5 def index @features = GreenFlag::Feature.order(:created_at).all end |
#show ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/green_flag/admin/features_controller.rb', line 9 def show @feature = GreenFlag::Feature.where(id: params[:id]).first @visitor_groups = GreenFlag::VisitorGroup.all.map { |group| { key: group.key, description: group.description } } end |