Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it work for objects other than ActiveModel #7

Closed
danpersa opened this issue Oct 17, 2011 · 7 comments
Closed

make it work for objects other than ActiveModel #7

danpersa opened this issue Oct 17, 2011 · 7 comments
Assignees
Milestone

Comments

@danpersa
Copy link

For example if I use the session object

<%= twitter_bootstrap_form_for(session, :url => sessions_path) do |f| %>

I get this error:

undefined method `model_name' for Rack::Session::Abstract::SessionHash:Class

@stouset
Copy link
Owner

stouset commented Oct 17, 2011

You need to add an :as => :session for a normal form_for or twitter_bootstrap_form_for to work without ActiveModel objects. However it looks like I still expect there to be an ActiveModel-style errors attribute.

I'll patch it to make it optional.

@stouset
Copy link
Owner

stouset commented Oct 17, 2011

This will go out in the next release. Let me know within the next day or so if you still have problems with non-ActiveModel objects. It's possible that I missed a corner case somewhere.

@danpersa
Copy link
Author

ok, thanks for the fast reply!

@stouset
Copy link
Owner

stouset commented Oct 17, 2011

The quickest way to test the patch to make sure it works for you is to replace the gem stanza in your Gemfile with:

gem 'twitter_bootstrap_form_for',
  :git => 'git://github.com/stouset/twitter_bootstrap_form_for.git'

@danpersa
Copy link
Author

I verified with the gem generated from the repository, and it works for my use case.
I'll notify you if there are further problems related to this issue.

Thanks

@stouset
Copy link
Owner

stouset commented Oct 18, 2011

I've got another fix to roll into 1.0.2, so this will go out later tonight or tomorrow morning.

@ghost ghost assigned stouset Oct 18, 2011
@stouset
Copy link
Owner

stouset commented Oct 31, 2011

Sorry, I completely forgot that this fix was pending a release. I've pushed out 1.0.2 with this change (and a few other improvements)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants