Fixed inclusion of helper TextFieldDateHelper into main app #1
Conversation
TextFieldDateHelper is not included as a helper in the app because it's not in the helpers directory. Added a workaround for this as I cannot figure out how to include it from the Engine without moving it into helpers directory. The problem manifests when trying to use a datetime field, which renders the exception: undefined method `text_field_date' for #<#<Class..."
I'm on Rails 3.2.1 and Formtastic 2.1.0-beta1 and if I add a Can you post the code that triggers the error message? |
What breaks is just trying to have an input for a datetime field, or specifying :as => :datetime
I tried a vanilla 3.2 app now seems to work fine with rails, but not in my production 3.1 app. When I googled this problem I saw some references as to this error depending on where in the Gemfile it is included so I guess there might be some magic going on. So maybe close this pull request then?
However there's another problem that I haven't dealt with yet and that is that the name of the field is wrong, the name ought to be post[foo(1i)] or something not post_foo[date].
|
It's a bit too long but at least it works.
I'm getting this error too undefined method `text_field_date' for #<#Class:0x00000105d84c48:0x00000105d80e40> My Gemfile : gem 'rails', '3.2.0' gem 'less-rails-bootstrap' |
I had problems getting rails to parse the date fields (date and time) automatically so I just switched back to using the vanilla formtastic datetime stuff in my branch. https://github.com/sunkencity/formtastic-bootstrap I'd really like to have a datepicker and stuff but I don't have the time to fix this properly now. There's a datepicker for bootstrap that will hopefully be in the next release, maybe I'll give it a shot then and try to provide it as a patch. |
yea i still have this issue on Rails 3.2.2 - can you please fix? |
I'm closing this pull request, should have created a special branch for it. Now everything that I commit ends up here, like the labels fix for bootstrap 2.0.2, which although nice, is out of context. |
TextFieldDateHelper is not included as a helper in the app because it's
not in the helpers directory. Added a workaround for this as I cannot
figure out how to include it from the Engine without moving it into
helpers directory. I don't really get why TextFieldDateHelper is not in the FormtasticBootstrap::Helpers::InputHelper namespace as these methods
seem to be included fine.
The problem manifests when trying to use a datetime
field, which renders the exception: undefined method `text_field_date'
for #<#<Class..."
Or is there some other way of accomplishing this? I'm running rails 3.1.0, perhaps I should update?