Use ruby 2.x hash syntax

This commit is contained in:
Thibault Jouan
2014-04-01 10:48:18 +00:00
parent 712e9501a2
commit da96c4814a
52 changed files with 148 additions and 148 deletions

View File

@@ -1,6 +1,6 @@
class API::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

@@ -1,11 +1,11 @@
class API::SessionsController < API::ApplicationController
skip_before_filter :authenticate!, :only => [:create]
skip_before_filter :authenticate!, only: [:create]
def create
user = User.find_by_email(params[:session][:email])
if ! user.try(:authenticate?, params[:session][:password])
return render :json => '', :status => :not_found
return render json: '', status: :not_found
end
@user = user

View File

@@ -2,6 +2,6 @@ class API::SoundsController < API::ApplicationController
# FIXME: add some tests!
def show
sound = Sound.find params[:id]
send_file sound.path, :type => sound.mime_type
send_file sound.path, type: sound.mime_type
end
end

View File

@@ -10,9 +10,9 @@ class PlaylistsController < ApplicationController
def create
@playlist = current_user.playlists.build(params[:playlist])
if @playlist.save
redirect_to :action => 'index'
redirect_to action: 'index'
else
render :action => 'new'
render action: 'new'
end
end
@@ -23,9 +23,9 @@ class PlaylistsController < ApplicationController
def update
@playlist = Playlist.find(params[:id])
if @playlist.update_attributes params[:playlist]
redirect_to :action => 'index'
redirect_to action: 'index'
else
render :action => 'edit'
render action: 'edit'
end
end
end

View File

@@ -1,5 +1,5 @@
class SessionsController < ApplicationController
skip_before_filter :authenticate!, :only => [:new, :create]
skip_before_filter :authenticate!, only: [:new, :create]
def create
user = User.find_by_email(params[:session][:email])

View File

@@ -1,6 +1,6 @@
class SoundsController < ApplicationController
def show
sound = Sound.find params[:id]
send_file sound.path, :type => sound.mime_type
send_file sound.path, type: sound.mime_type
end
end

View File

@@ -1,5 +1,5 @@
class UsersController < ApplicationController
skip_before_filter :authenticate!, :only => [:new, :create]
skip_before_filter :authenticate!, only: [:new, :create]
def new
@user = User.new