Module: Lookbook::ApplicationHelper
- Defined in:
- app/helpers/lookbook/application_helper.rb
Instance Method Summary collapse
- #frame_request? ⇒ Boolean
- #lookbook_asset_path(file, version: true) ⇒ Object
- #lookbook_landing_path ⇒ Object
-
#request_frame ⇒ Object
Requests.
Instance Method Details
#frame_request? ⇒ Boolean
23 24 25 |
# File 'app/helpers/lookbook/application_helper.rb', line 23 def frame_request? request.headers["X-Lookbook-Frame"].present? end |
#lookbook_asset_path(file, version: true) ⇒ Object
3 4 5 6 |
# File 'app/helpers/lookbook/application_helper.rb', line 3 def lookbook_asset_path(file, version: true) path = "#{Engine.host_config.relative_url_root}/lookbook-assets/#{file}".gsub("//", "/") version ? "#{path}?v=#{Lookbook::VERSION}" : path end |
#lookbook_landing_path ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/helpers/lookbook/application_helper.rb', line 8 def lookbook_landing_path landing = Engine.pages.find(&:landing?) || Engine.pages.first if landing.present? lookbook_page_path landing.lookup_path else lookbook_home_path end end |
#request_frame ⇒ Object
Requests
19 20 21 |
# File 'app/helpers/lookbook/application_helper.rb', line 19 def request_frame request.headers["X-Lookbook-Frame"] || "root" end |