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

subregion_select helper doesnt allow to give classes #49

Open
indranil-m opened this issue Sep 26, 2014 · 1 comment
Open

subregion_select helper doesnt allow to give classes #49

indranil-m opened this issue Sep 26, 2014 · 1 comment

Comments

@indranil-m
Copy link

We couldn't pass class names in subregion_select helper;

tried below samples:

subregion_select(:shipping_address, :state_id, parent_region, :html_options => {:class => 'form-control'})
AND
subregion_select(:billing_address, :state_id, parent_region, class: 'form-control')

@panagioti
Copy link

I spent about three hours trying a whole slew of things here. I expected that the documented approach would work, namely:

<%= subregion_select( @MODEL_NAME, :NAME_OF_ATTRIBUTE_IN_MODEL, parent_region, :class => 'form-control' ) %>

Yet, this did not work very well.

Eventually, I found one approach that worked where two hashes are included in the call to subregion_select (one empty, the other specifying the bootstrap class for the dropdown styling).

<%= subregion_select( @MODEL_NAME, :NAME_OF_ATTRIBUTE_IN_MODEL, parent_region, {}, { :class => 'form-control' } ) %>

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