Font Awesome, jbuilder templates, getting rid of beatparser

This commit is contained in:
Gregory Eremin
2012-09-09 17:48:24 +04:00
parent be5a643b55
commit 9cb145f0d7
42 changed files with 520 additions and 233 deletions
+3 -5
View File
@@ -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
+3 -5
View File
@@ -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
+5
View File
@@ -0,0 +1,5 @@
module Api
class BaseController < ::ApplicationController
respond_to :json
end
end
+1 -1
View File
@@ -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 -1
View File
@@ -1,5 +1,5 @@
module Api
class SessionController < ApplicationController
class SessionController < BaseController
def auth
render json: { error: "Signature verification failed!" } unless request_valid?