Class: SlugInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
app/inputs/slug_input.rb

Instance Method Summary collapse

Instance Method Details

#inputObject



2
3
4
5
6
7
8
9
# File 'app/inputs/slug_input.rb', line 2

def input
  prefix  = template. :span, template.main_app.root_url, :class => 'root-url'
  field   = @builder.text_field(attribute_name, input_html_options)
  done    = template. :button, I18n.t('helpers.submit.slug.done', :default => 'Done'),   :class => 'btn done'
  cancel  = template. :a, I18n.t('helpers.submit.slug.cancel', :default => 'Cancel'), :href => '#', :class => 'cancel'
  or_word = I18n.t('helpers.submit.slug.or', :default => 'or')
  "#{prefix} #{field} #{done} #{or_word} #{cancel}".html_safe
end