Class: OutroRails::ScalesController

Inherits:
ApplicationController show all
Includes:
InstrumentSelectable, InvalidParamsRedirectable, RootSelectable
Defined in:
app/controllers/outro_rails/scales_controller.rb

Constant Summary collapse

DEFAULT_TYPE =
"major"

Constants included from InstrumentSelectable

InstrumentSelectable::INSTRUMENTS

Constants included from RootSelectable

RootSelectable::DEFAULT_ROOT

Instance Method Summary collapse

Instance Method Details

#indexObject



15
16
# File 'app/controllers/outro_rails/scales_controller.rb', line 15

def index
end

#showObject



18
19
20
21
22
23
24
25
26
# File 'app/controllers/outro_rails/scales_controller.rb', line 18

def show
  @instrument = params.fetch(:instrument)
  @scale = Theory::Scale.new(root_from_params, type_param)

  case @instrument
  when "piano"  then prepare_piano
  when "guitar" then prepare_guitar
  end
end