Class: MagicLamp::FixturesController

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

Constant Summary collapse

ERRORS =
[
  MagicLamp::ArgumentError,
  MagicLamp::AlreadyRegisteredFixtureError,
  MagicLamp::AmbiguousFixtureNameError,
  MagicLamp::UnregisteredFixtureError,
  MagicLamp::AttemptedRedirectError,
  MagicLamp::DoubleRenderError
].map(&:name)

Instance Method Summary collapse

Instance Method Details

#indexObject



23
24
25
# File 'app/controllers/magic_lamp/fixtures_controller.rb', line 23

def index
  render json: MagicLamp.generate_all_fixtures
end

#showObject



18
19
20
21
# File 'app/controllers/magic_lamp/fixtures_controller.rb', line 18

def show
  MagicLamp.load_lamp_files
  render text: MagicLamp.generate_fixture(params[:name])
end