Class: GreenFlag::Admin::FeaturesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/green_flag/admin/features_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_visitor_statusObject



14
15
16
17
18
# File 'app/controllers/green_flag/admin/features_controller.rb', line 14

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

#indexObject



5
6
7
# File 'app/controllers/green_flag/admin/features_controller.rb', line 5

def index
  @features = GreenFlag::Feature.all
end

#showObject



9
10
11
12
# File 'app/controllers/green_flag/admin/features_controller.rb', line 9

def show
  @feature = GreenFlag::Feature.find(params[:id])
  @visitor_groups = GreenFlag::VisitorGroup.all.map { |group| { key: group.key, description: group.description } }
end