Class: FactoryGirlWeb::FixturesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/factory_girl_web/fixtures_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/factory_girl_web/fixtures_controller.rb', line 9

def create
  fixture = Fixture.new(permitted_params)

  if fixture.create
    redirect_to :back, notice: format("%{model} was successfully created.", model: fixture.name_i18n)
  else
    redirect_to :back, alert: fixture.errors.full_messages.to_sentence
  end
end

#indexObject



5
6
7
# File 'app/controllers/factory_girl_web/fixtures_controller.rb', line 5

def index
  @fixtures = Fixture.all
end