Fix coding standards in application files
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module API
|
||||
class ApplicationController < ::ApplicationController
|
||||
skip_before_filter :verify_authenticity_token
|
||||
skip_before_filter :authenticate!, only: [:cor_preflight]
|
||||
skip_before_filter :authenticate!, only: :cor_preflight
|
||||
|
||||
before_filter :cor_filter
|
||||
|
||||
|
@@ -5,14 +5,15 @@ module API
|
||||
end
|
||||
|
||||
def create
|
||||
@playlist = current_user.playlists.build(playlist_params)
|
||||
@playlist = current_user.playlists.build playlist_params
|
||||
@playlist.save
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def playlist_params
|
||||
params.require(:playlist).permit(:name)
|
||||
params.require(:playlist).permit :name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -1,11 +1,11 @@
|
||||
module API
|
||||
class SessionsController < ApplicationController
|
||||
skip_before_filter :authenticate!, only: [:create]
|
||||
skip_before_filter :authenticate!, only: :create
|
||||
|
||||
def create
|
||||
user = User.find_by_email(params[:session][:email])
|
||||
|
||||
unless user.try(:authenticate?, params[:session][:password])
|
||||
unless user.try :authenticate?, params[:session][:password]
|
||||
return render json: '', status: :not_found
|
||||
end
|
||||
|
||||
|
@@ -2,7 +2,7 @@ module API
|
||||
class SoundsController < ApplicationController
|
||||
# FIXME: add some tests!
|
||||
def show
|
||||
sound = Sound.find params[:id]
|
||||
sound = Sound.find(params[:id])
|
||||
send_file sound.path, type: sound.mime_type
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user