Created
January 14, 2015 13:42
-
-
Save brunoandradd/6f5fe47b92d66df40aae to your computer and use it in GitHub Desktop.
helper_method_example.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :null_session | |
before_action :set_locale | |
before_filter :authenticate_user! | |
self.responder = AppResponder | |
respond_to :html | |
helper_method :current_salon | |
def current_salon | |
current_user.userable | |
end | |
def set_locale | |
I18n.locale = params[:locale] || I18n.default_locale | |
end | |
def default_url_options(options={}) | |
{ :locale => I18n.locale } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment