Class: OMF::Web::Theme::MustacheRenderer
- Inherits:
-
Erector::Widget
- Object
- Erector::Widget
- OMF::Web::Theme::MustacheRenderer
- Defined in:
- lib/omf-web/theme/bright/mustache_renderer.rb
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(widget, opts) ⇒ MustacheRenderer
constructor
A new instance of MustacheRenderer.
Constructor Details
#initialize(widget, opts) ⇒ MustacheRenderer
Returns a new instance of MustacheRenderer.
8 9 10 11 12 |
# File 'lib/omf-web/theme/bright/mustache_renderer.rb', line 8 def initialize(, opts) super opts @widget = @opts = opts end |
Instance Method Details
#content ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/omf-web/theme/bright/mustache_renderer.rb', line 14 def content() base_id = "mr#{self.object_id}" opts = @opts.dup opts[:base_id] = base_id div :id => base_id, :class => "mustache_widget" do javascript(%{ L.require('#OML.mustache', 'js/mustache', function() { OML.mustache(#{opts.to_json}); }); }) end end |