Class: Voluntary::Api::V1::Music::ReleasesController
- Inherits:
-
BaseController
- Object
- BaseController
- Voluntary::Api::V1::Music::ReleasesController
- Defined in:
- app/controllers/voluntary/api/v1/music/releases_controller.rb
Instance Method Summary collapse
Instance Method Details
#bulk ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/voluntary/api/v1/music/releases_controller.rb', line 16 def bulk respond_to do |format| format.json { render json: MusicRelease.(params[:releases]).to_json } end end |
#index ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/controllers/voluntary/api/v1/music/releases_controller.rb', line 8 def index respond_to do |format| format.json { render json: MusicRelease.where(artist_id: params[:artist_id]).order('released_at DESC').map(&:to_json).to_json } end end |
#show ⇒ Object
22 23 24 25 26 |
# File 'app/controllers/voluntary/api/v1/music/releases_controller.rb', line 22 def show respond_to do |format| format.json { render json: MusicRelease.find(params[:id]).to_json } end end |