jam-cloud/web/app/controllers/api_subjects_controller.rb

17 lines
294 B
Ruby

class ApiSubjectsController < ApiController
respond_to :json
def index
@subjects = Subject.order(:description)
respond_with @subjects
end
def show
@subject = Subject.find(params[:id])
gon.subject_id = @subject.id
gon.description = @subject.description
end
end