19 lines
460 B
Ruby
19 lines
460 B
Ruby
class ApiInstrumentsController < ApiController
|
|
|
|
# have to be signed in currently to see this screen
|
|
before_filter :signed_in_user
|
|
|
|
respond_to :json
|
|
|
|
def index
|
|
@instruments = Instrument.where('instruments.popularity > 0').order('instruments.popularity DESC, instruments.description ASC')
|
|
end
|
|
|
|
def show
|
|
@instrument = Instrument.find(params[:id])
|
|
gon.instrument_id = @instrument.id
|
|
gon.description = @instrument.description
|
|
end
|
|
|
|
end
|