Module: Rack::Webconsole::AssetHelpers
- Included in:
- Assets
- Defined in:
- lib/rack/webconsole/asset_helpers.rb
Overview
Helper module to encapsulate the asset loading logic used by the Assets middleware.
For now, the strategy is reading the files from disk. In the future, we should come up with a somewhat more sophisticated strategy, although Rack::Webconsole is used only in development environments, where performance isn't usually a concern.
Instance Method Summary (collapse)
-
- (String) css_code
Loads the CSS from a file in `/public`.
-
- (String) html_code
Loads the HTML from a file in `/public`.
-
- (String) js_code
Loads the JavaScript from a file in `/public`.
Instance Method Details
- (String) css_code
Loads the CSS from a file in `/public`.
It contains the styles for the console.
27 28 29 30 31 |
# File 'lib/rack/webconsole/asset_helpers.rb', line 27 def css_code '<style type="text/css">' << asset('webconsole.css') << '</style>' end |
- (String) html_code
Loads the HTML from a file in `/public`.
It contains a form and the needed divs to render the console.
18 19 20 |
# File 'lib/rack/webconsole/asset_helpers.rb', line 18 def html_code asset 'webconsole.html' end |
- (String) js_code
Loads the JavaScript from a file in `/public`.
It contains the JavaScript logic of the webconsole.
38 39 40 41 42 |
# File 'lib/rack/webconsole/asset_helpers.rb', line 38 def js_code '<script type="text/javascript">' << asset('webconsole.js') << '</script>' end |