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



17
18
19
20
21
22
23
24
25
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 17

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



42
43
44
45
46
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 42

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

#editObject



27
28
29
30
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 27

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

#indexObject



5
6
7
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 5

def index
  @ab_tests = AbTest.all
end

#newObject



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

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

#showObject



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

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

#updateObject



32
33
34
35
36
37
38
39
40
# File 'app/controllers/i_wonder/ab_tests_controller.rb', line 32

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