Module: ShopQiApp::ApplicationHelper
- Included in:
- ApplicationController
- Defined in:
- app/helpers/shopqi_app/application_helper.rb
Instance Method Summary collapse
-
#authenticate_shop! ⇒ Object
必须通过认证.
- #current_shop ⇒ Object
- #shop_url ⇒ Object
- #signed_in? ⇒ Boolean
Instance Method Details
#authenticate_shop! ⇒ Object
必须通过认证
3 4 5 |
# File 'app/helpers/shopqi_app/application_helper.rb', line 3 def authenticate_shop! # 必须通过认证 redirect_to main_app.root_path unless signed_in? end |
#current_shop ⇒ Object
11 12 13 |
# File 'app/helpers/shopqi_app/application_helper.rb', line 11 def current_shop @current_shop ||= (.signed[:shop_id] && Shop.find_by_id(.signed[:shop_id])) end |
#shop_url ⇒ Object
15 16 17 |
# File 'app/helpers/shopqi_app/application_helper.rb', line 15 def shop_url "http://#{current_shop.shopqi_domain}" end |
#signed_in? ⇒ Boolean
7 8 9 |
# File 'app/helpers/shopqi_app/application_helper.rb', line 7 def signed_in? !current_shop.nil? end |