Add active_language controller and cookie storage
This commit is contained in:
10
app/controllers/active_language_controller.rb
Normal file
10
app/controllers/active_language_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class ActiveLanguageController < ApplicationController
|
||||
|
||||
def set_active_language
|
||||
if Language.find_by_id(params[:active_language_id]) != nil
|
||||
cookies[:active_language_id] = params[:active_language_id]
|
||||
else
|
||||
redirect_to root_path, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user