beathaven/app/controllers/api/albums_controller.rb

16 lines
318 B
Ruby
Raw Normal View History

2012-08-27 03:53:30 +04:00
module Api
class AlbumsController < ::ApplicationController
def picture
album = Album.find(params[:id])
redirect_to album.load_pic
end
2012-09-01 21:55:01 +04:00
def show
album = Album.find(params[:id])
return render json: { fail: true } if album.nil?
render json: album.dump_json
end
2012-08-27 03:53:30 +04:00
end
end