Module: PrototypeReplacementHelper

Defined in:
app/helpers/prototype_replacement_helper.rb

Instance Method Summary collapse

Instance Method Details

#remote_button(label, url, data, html_options = {}) ⇒ Object


2
3
4
5
6
# File 'app/helpers/prototype_replacement_helper.rb', line 2

def remote_button(label, url, data, html_options = {})
  form_tag url, remote: true, data: data, class: 'remote-form' do
    submit_tag(label, html_options)
  end
end

#tooltip(name = 'Help', opts = {}, &block) ⇒ Object


8
9
10
11
12
# File 'app/helpers/prototype_replacement_helper.rb', line 8

def tooltip(name = 'Help', opts = {}, &block)
  button = (:span, name, class: 'btn btn-info popover-trigger', 'data-content': capture(opts, &block),
                                    'data-toggle': 'popover', 'data-title': opts.fetch(:title, 'About this'))
  concat button
end