Class ScaleNotesController
In: app/controllers/scale_notes_controller.rb
Parent: JazzController

Scale Notes REST API

Accessible within scale context only. Represents notes in a given scale. See ScaleTonesController for information about scale tones.

Methods

Public Instance methods

GET /scale/Cmajor/notes GET /scale/Cmajor/notes.xml GET /scale/Cmajor/notes.js

[Source]

    # File app/controllers/scale_notes_controller.rb, line 13
13:   def index
14:     respond_to do |format|
15:       format.html
16:       format.xml { render :xml => @scale_notes.to_xml }
17:                         format.js { render :text => @scale_notes.to_json }
18:     end
19:   end

GET /scale/Cmajor/notes/1 (Where 1 is position in scale) GET /scale/Cmajor/notes/1.xml GET /scale/Cmajor/notes/1.js

[Source]

    # File app/controllers/scale_notes_controller.rb, line 24
24:   def show
25:     respond_to do |format|
26:       format.html
27:       format.xml { render :xml => '<note>' + @scale_note + '</note>' }
28:                         format.js { render :text => @scale_note }
29:     end
30:   end

Protected Instance methods

[Source]

    # File app/controllers/scale_notes_controller.rb, line 48
48:         def find_scale
49:                 @scale = Scale[params[:scale_id]]
50:         end

[Source]

    # File app/controllers/scale_notes_controller.rb, line 41
41:         def find_scale_note
42:                 find_scale
43:                 find_scale_notes
44:                 
45:                 @scale_note = @scale_notes[params[:id].to_i]
46:         end

[Source]

    # File app/controllers/scale_notes_controller.rb, line 35
35:         def find_scale_notes
36:                 find_scale
37:                 
38:                 @scale_notes = @scale.notes
39:         end

[Validate]