Module: PrototypeReplacementHelper

Defined in:
app/helpers/prototype_replacement_helper.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

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


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

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


9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/prototype_replacement_helper.rb', line 9

def tooltip(name = 'Help', opts = {}, &block)
  button =
    tag.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