Skip to content
Browse files

Cleanup

Signed-off-by: Phil Burrows <peburrows@gmail.com>
  • Loading branch information...
1 parent 7e86b81 commit 8cd8541ec8342c4264e42248696b417fd969e605 @manuelmeurer manuelmeurer committed with Jan 5, 2009
Showing with 2 additions and 14 deletions.
  1. +2 −14 app/controllers/language_controller.rb
View
16 app/controllers/language_controller.rb
@@ -1,20 +1,8 @@
class LanguageController < ApplicationController
- # Remove this line if your controller should only be accessible to users
- # that are logged in:
no_login_required
def set_lang
- # setting up the :language session variable which will be referenced in the tags
- if params[:language].downcase == 'reset'
- session[:language] = nil
- else
- session[:language] = params[:language].downcase
- end
-
- if !params[:from].blank?
- redirect_to params[:from] and return
- else
- redirect_to '/' and return
- end
+ session[:language] = params[:language].downcase == 'reset' ? nil : params[:language].downcase
+ redirect_to(params[:from] || '/')
end
end

0 comments on commit 8cd8541

Please sign in to comment.
Something went wrong with that request. Please try again.