Module: Abingo::Controller::Dashboard

Defined in:
lib/abingo/controller/dashboard.rb

Instance Method Summary collapse

Instance Method Details

#end_experimentObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/abingo/controller/dashboard.rb', line 12

def end_experiment
  @alternative = Abingo::Alternative.find(params[:id])
  @experiment = Abingo::Experiment.find(@alternative.experiment_id)
  if (@experiment.status != "Completed")
    @experiment.end_experiment!(@alternative.content)
    flash[:notice] = "Experiment marked as ended.  All users will now see the chosen alternative."
  else
    flash[:notice] = "This experiment is already ended."
  end
  redirect_to :action => "index"
end

#indexObject

ActionController::Base.view_paths.unshift File.join(File.dirname(__FILE__), “../views”)



7
8
9
10
# File 'lib/abingo/controller/dashboard.rb', line 7

def index
  @experiments = Abingo::Experiment.all
  render :template => 'dashboard/index'
end