Fix coding standards in application files

This commit is contained in:
Thibault Jouan
2015-04-30 08:52:00 +00:00
parent 737ac1f10a
commit 3b733c349e
16 changed files with 34 additions and 26 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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