Module: Arturo::FeaturesHelper

Includes:
ActionView::Helpers::TagHelper
Defined in:
app/helpers/arturo/features_helper.rb

Instance Method Summary collapse

Instance Method Details

#deployment_percentage_output_tag(id, value) ⇒ Object



23
24
25
# File 'app/helpers/arturo/features_helper.rb', line 23

def deployment_percentage_output_tag(id, value)
  (:output, value, { 'for' => id, 'class' => 'deployment_percentage no_js' })
end

#deployment_percentage_range_and_output_tags(name, value, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/arturo/features_helper.rb', line 8

def deployment_percentage_range_and_output_tags(name, value, options = {})
  id = sanitize_to_id(name)
  options = {
    'type' => 'range',
    'name' => name,
    'id' => id,
    'value' => value,
    'min' => '0',
    'max' => '100',
    'step' => '1',
    'class' => 'deployment_percentage'
  }.update(options.stringify_keys)
  tag(:input, options) + deployment_percentage_output_tag(id, value)
end