Class: Volt::BaseIndexRenderer
- Defined in:
- lib/volt/cli/base_index_renderer.rb
Instance Method Summary collapse
- #css_tags ⇒ Object
- #html ⇒ Object
-
#initialize(volt_app, manifest) ⇒ BaseIndexRenderer
constructor
A new instance of BaseIndexRenderer.
-
#javascript_tags ⇒ Object
When writing the index, we render the.
Constructor Details
#initialize(volt_app, manifest) ⇒ BaseIndexRenderer
Returns a new instance of BaseIndexRenderer.
6 7 8 9 |
# File 'lib/volt/cli/base_index_renderer.rb', line 6 def initialize(volt_app, manifest) @volt_app = volt_app @manifest = manifest end |
Instance Method Details
#css_tags ⇒ Object
23 24 25 |
# File 'lib/volt/cli/base_index_renderer.rb', line 23 def "<link href=\"#{@volt_app.app_url}/#{@manifest['assets']['main/app.css']}\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />" end |
#html ⇒ Object
11 12 13 14 15 16 |
# File 'lib/volt/cli/base_index_renderer.rb', line 11 def html index_path = File.(File.join(Volt.root, 'config/base/index.html')) html = File.read(index_path) ERB.new(html, nil, '-').result(binding) end |
#javascript_tags ⇒ Object
When writing the index, we render the
19 20 21 |
# File 'lib/volt/cli/base_index_renderer.rb', line 19 def "<script src=\"#{@volt_app.app_url}/#{@manifest['assets']['main/app.js']}\"></script>" end |