Closed jigfox closed 10 years ago
:+1: 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!
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
I somehow missed this PR before opening #41. #41 should retain Rails 3 compatibility.
Closed in favor of #41.
+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.