Module: Breakfast::ViewHelper

Includes:
ActionView::Helpers::AssetTagHelper, ActionView::Helpers::AssetUrlHelper
Defined in:
lib/breakfast/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#breakfast_autoreload_tagObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/breakfast/view_helper.rb', line 3

def breakfast_autoreload_tag
  if Rails.configuration.breakfast.environments.include?(Rails.env)
     :script do
      "        require(\"breakfast-rails\").init({\n          host: \"\#{request.host}\",\n          port: \#{request.port},\n          strategies: {\n            js: \"\#{Rails.configuration.breakfast.js_reload_strategy}\",\n            css: \"\#{Rails.configuration.breakfast.css_reload_strategy}\",\n            html: \"\#{Rails.configuration.breakfast.html_reload_strategy}\",\n            rb: \"\#{Rails.configuration.breakfast.ruby_reload_strategy}\"\n          },\n          statusBarLocation: \"\#{Rails.configuration.breakfast.status_bar_location}\"\n        });\n      SCRIPT\n    end\n  end\nend\n".html_safe

#compute_asset_path(path, options = {}) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/breakfast/view_helper.rb', line 26

def compute_asset_path(path, options = {})
  if Rails.configuration.breakfast.digest && Rails.configuration.breakfast.manifest.asset(path)
    path = Rails.configuration.breakfast.manifest.asset(path)
  end

  super(path, options)
end