kaps_app/app/inputs/date_input.rb
Nicolas Bally d60301e8a7 initial
2019-01-21 01:15:10 +01:00

27 lines
878 B
Ruby

class DateInput < Formtastic::Inputs::TextInput
include FormtasticBootstrap::Inputs::Base
def to_html
r = rand(1000000000000000000000000000)
bootstrap_wrapping do
builder.text_field(method.to_s, input_html_options.merge!(:class => "datepicker form-control"))
end
end
def to_htmldffgddfg
r = rand(1000000000000000000000000000)
input_wrapping do
label_html +
template.content_tag(:fieldset, template.text_field_tag("cible_name", (object.cible ? object.cible.cible_name : "aucuns élément séléctionné"), :id =>"name_#{r}" ) +
self.manager_select_cible_link(method, options, r) + builder.hidden_field(method.to_s+"_id", input_html_options.merge!(:id => "input_id_"+r.to_s)) +
builder.hidden_field(method.to_s+"_type", input_html_options.merge!(:id => "input_type_"+r.to_s)) )
end
end
end