| Class | ModesController |
| In: |
app/controllers/modes_controller.rb
|
| Parent: | JazzController |
Accessible only within scale context. Represents the defined modes of a given scale.
GET /scales/major/modes GET /scales/major/modes.xml GET /scales/major/modes.js
# File app/controllers/modes_controller.rb, line 13
13: def index
14: respond_to do |format|
15: format.html
16: format.xml { render :xml => @modes.to_xml }
17: format.js { render :text => @modes.to_json }
18: end
19: end
GET /scales/major/modes/1 GET /scales/major/modes/1.xml GET /scales/major/modes/1.js
# File app/controllers/modes_controller.rb, line 24
24: def show
25: respond_to do |format|
26: format.html
27: format.xml { render :xml => @mode.to_xml }
28: format.js { render :text => @mode.to_json }
29: end
30: end
# File app/controllers/modes_controller.rb, line 45
45: def find_mode
46: find_relateds
47:
48: @mode = @scale.modes[params[:id]]
49: end
# File app/controllers/modes_controller.rb, line 35
35: def find_modes
36: find_relateds
37:
38: @modes = case
39: when @scale then @scale.modes
40: when @chord then @chord.modes
41: else Mode.find(:all)
42: end
43: end