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

Already on GitHub? Sign in to your account

rails needs hash with the object on key :object #36

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants

jigfox commented Sep 10, 2013

No description provided.

+1

with the actual code, using form_for and this line:

<%= f.country_select :country, { priority: %w(BR), object: f.object } %>

generates a wrong number of arguments (1 for 0) exception.

@ghost

ghost commented Dec 13, 2013

👍 Had the exact issue above.

I'm currently using the below in my Gemfile right now to get Carmen-Rails to work in Rails 4.0.1 with SimpleForm.

gem 'carmen-rails', '~> 1.0.0', github: 'jigfox/carmen-rails', branch: 'patch-1' 

Please merge this PR and release a new gem!

Dan,

Did you get the 'State' filed to automatically populate based on the 'country' field selection?
Can you post the relevant code please? (Gemfile, view/partials/JS ?)
Thanks in advance!

@ghost

ghost commented Dec 13, 2013

Sorry @robsilva no I have not. My application is only using US States right now, so I just wrote a helper to do it outside of any JS.

require 'carmen'

module ApplicationHelper
  include Carmen

  def us_states_for_select
    Country.named('United States').subregions.map{|state| [state.name, state.code]}
  end
end
Contributor

bshelton229 commented Jan 9, 2014

I somehow missed this PR before opening #41. #41 should retain Rails 3 compatibility.

Owner

jim commented Mar 6, 2014

Closed in favor of #41.

@jim jim closed this Mar 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment