Sha256: 72ba8a51aa20b0caf5c5eca21976f0188dcb0a0c0f2759b666debf66895d29f6

Contents?: true

Size: 330 Bytes

Versions: 6

Compression:

Stored size: 330 Bytes

Contents

ApplicationHelper.class_eval do

  def widget name, opts={}
    tag, name = name.split(':') if name === String

    tag = :div
    id  = Lux.current.uid

    data = block_given? ? yield : nil

    { class: 'w %s' % name, id: id, 'data-json': opts.to_json }.tag(tag, data) +
    %[<script>Widget.bind('#{id}');</script>]
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lux-fw-0.5.37 ./plugins/js_widgets/js_widgets.rb
lux-fw-0.5.36 ./plugins/js_widgets/js_widgets.rb
lux-fw-0.5.35 ./plugins/js_widgets/js_widgets.rb
lux-fw-0.5.34 ./plugins/js_widgets/js_widgets.rb
lux-fw-0.5.33 ./plugins/js_widgets/js_widgets.rb
lux-fw-0.5.32 ./plugins/js_widgets/js_widgets.rb