Font Awesome, jbuilder templates, getting rid of beatparser
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
module Api
|
||||
class AlbumsController < ::ApplicationController
|
||||
class AlbumsController < BaseController
|
||||
def picture
|
||||
album = Album.find(params[:id])
|
||||
redirect_to album.load_pic
|
||||
end
|
||||
|
||||
def show
|
||||
album = Album.find(params[:id])
|
||||
return render json: { fail: true } if album.nil?
|
||||
|
||||
render json: album.dump_json
|
||||
@album = Album.find(params[:id])
|
||||
return render json: { fail: true } if @album.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
module Api
|
||||
class ArtistsController < ::ApplicationController
|
||||
class ArtistsController < BaseController
|
||||
def show
|
||||
artist = Artist.with_name(params[:id].gsub("+", " "))
|
||||
return render json: { fail: true } if artist.nil?
|
||||
|
||||
render json: artist.dump_json
|
||||
@artist = Artist.with_name(params[:id].gsub("+", " "))
|
||||
return render json: { fail: true } if @artist.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
module Api
|
||||
class BaseController < ::ApplicationController
|
||||
respond_to :json
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
module Api
|
||||
class SearchController < ApplicationController
|
||||
class SearchController < BaseController
|
||||
def complete
|
||||
return render json: { suggestions: [] } if params[:query].to_s.length == 0
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module Api
|
||||
class SessionController < ApplicationController
|
||||
class SessionController < BaseController
|
||||
|
||||
def auth
|
||||
render json: { error: "Signature verification failed!" } unless request_valid?
|
||||
|
||||
Reference in New Issue
Block a user