CultivateLabs / storytime

Storytime is a Rails 4+ CMS and blogging engine, with a core focus on content. It is built and maintained by @cultivatelabs
MIT License
752 stars 81 forks source link

Default wrapper options not passed to DateTime picker #124

Closed storm255 closed 9 years ago

storm255 commented 9 years ago

Getting an error relating to missing value for the SimpleForm parameter.

Not sure what the expected behaviour is. Perhaps the input is normally passed options when overridden as in the case with Storytime or should it just have an empty Hash by default.

# app/inputs/date_time_picker_input.rb
class DateTimePickerInput < SimpleForm::Inputs::Base
  def input(wrapper_options)
    template.content_tag(:div, class: 'form-group date time form_datetime') do
      template.concat @builder.text_field(attribute_name, date_input_html_options)
      template.concat @builder.text_field(attribute_name, time_input_html_options)
    end
  end
bcroesch commented 9 years ago

Which version of simple form are you on? I ran into this on another site and I think I solved it by bumping my simple form version. If you're seeing that too, we should probably bump our required version of simple form to >=3.1

https://github.com/plataformatec/simple_form/issues/1139 was the relevant issue for me.

storm255 commented 9 years ago

Good catch. I was on 3.0.2 and updating to 3.1.0 fixed it as per your comment.