-
Notifications
You must be signed in to change notification settings - Fork 219
as: :select unrecognized input on non-model form when using PostgreSQL #109
Comments
What versions of rails, formtastic, formtastic-bootstrap are you using? |
|
formtastic-bootstrap 3.0 actually only support formtastic 2.x. Try downgrading to formtastic 2.3.1 and see if it resolves the issue? |
That worked, though it made all the bootstrap styles on my form elements stop working :/ |
Yeah it looks like once I did that none of my text inputs are using the new bootstrap styles. Is there a way to fix this and still use the bootstrap 3.x styles? |
UPDATE: so it looks like I have to force formtastic-bootstrap to be 3.0.0, but keep formtastic at 2.3.1 and then everything works. |
Yes, that's the expected combination. I will update the gemspec today to show the f-b 3 doesn't support f 3. |
Are there any plans to support formtastic 3? |
I'm happy to accept Pull Requests to make us compatible with Formtastic 3. I'm not sufficiently familiar with the changes in F3 to know if we can be compatible with both Formtastic 2.3 and 3.0 at the same time – mostly this is a matter of picking sensible version numbers. |
UPDATE: this is fixed with this commit: Formtastic is still v 3.0.0 as my gem previously stated, but sourcing from github brings that important commit which fixes this situation. |
Thanks for the update. I'll try to make time for a release soon. |
EDIT: turns out it had nothing with moving to postgresql --- I ran bundle update and that pushed formtastic to 3.0.0, which is what broke everything. See #109 (comment) for solution
I had a form that was working perfectly when I was using SQLite. I moved to PostgreSQL and for some reason this broke formtastic-bootstrap's ability to recognize :select as an input type.
Formtastic::UnknownInputError - "Unable to find input class for select"
To reproduce this error try the following:
Add the following to the top of the auto-generated app/views/posts/index.html.erb file:
Add the required styles and gem files etc for formtastic-bootstrap
Now run rails server
Navigate to http://localhost:3000 in your web browser. You should now get the same error I'm getting.
This is a model-less form, which is supported according to the formtastic documentation as long as you specify an "as:" for each input.
As far as I can tell this will not throw the same error if you use SQLite.
What could be causing this error?
The text was updated successfully, but these errors were encountered: