2011-11-25 14:10:56 +00:00
|
|
|
module Locomotive
|
|
|
|
class SubdomainInput < Formtastic::Inputs::TextInput
|
|
|
|
|
|
|
|
def wrapper_html_options
|
|
|
|
super.tap do |opts|
|
|
|
|
opts[:class] += ' path'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def to_html
|
|
|
|
domain = options.delete(:domain)
|
|
|
|
|
|
|
|
input_wrapping do
|
|
|
|
label_html <<
|
2011-11-29 01:24:02 +00:00
|
|
|
template.content_tag(:em, "http://") <<
|
2011-11-25 14:10:56 +00:00
|
|
|
builder.text_field(method, input_html_options) <<
|
2011-12-02 17:20:59 +00:00
|
|
|
template.content_tag(:em, ".#{domain}", :class => 'error-anchor')
|
2011-11-25 14:10:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|