Class: IWonder::AbTestsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/i_wonder/ab_tests_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
29
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 21

def create
  @ab_test = AbTest.new(params[:ab_test])

  if @ab_test.save
    redirect_to @ab_test, :notice => "Successfully created ABTest"
  else
    render "new"
  end
end

#destroyObject



46
47
48
49
50
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 46

def destroy
  @ab_test = AbTest.find(params[:id])
  @ab_test.destroy
  redirect_to ab_tests_path, :notice => "ABTest has been destroyed"
end

#editObject



31
32
33
34
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 31

def edit
  @ab_test = AbTest.find(params[:id])
  render "edit"
end

#indexObject



9
10
11
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 9

def index
  @ab_tests = AbTest.all
end

#newObject



17
18
19
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 17

def new
  @ab_test = AbTest.new(params[:ab_test])
end

#showObject



13
14
15
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 13

def show
  @ab_test = AbTest.find(params[:id])
end

#updateObject



36
37
38
39
40
41
42
43
44
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 36

def update
  @ab_test = AbTest.find(params[:id])

  if @ab_test.update_attributes(params[:ab_test])
    redirect_to @ab_test, :notice => "Successfully updated ABTest"
  else
    render "edit"
  end
end