Module: BlogBasic::ApplicationHelper
- Defined in:
- app/helpers/blog_basic/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#current_user ⇒ Object
8 9 10 11 12 13 |
# File 'app/helpers/blog_basic/application_helper.rb', line 8 def current_user logger.info "Current user ID: " + session[:user_id].to_s if signed_in? session[:user_id] end end |
#ensure_signed_in ⇒ Object
15 16 17 18 19 20 |
# File 'app/helpers/blog_basic/application_helper.rb', line 15 def ensure_signed_in unless signed_in? session[:redirect_to] = request.request_uri redirect_to(new_session_path) end end |