0

I have table for state and country with association like country has many states.

I want to build a state select tag based on country select. Like nested select tags without any gems or plugins. Is any helper method presents to perform above task.I don’t want JavaScript stuff here.

1 Answer 1

1

If you want to populate your state dropdown based on what is there in the country dropdown, you have to use javascript. There is no other way.

Sign up to request clarification or add additional context in comments.

2 Comments

I have referred some answers and got some gems to do such as acts_as_nested_set, or awesome_nested_set.. I want to know which will be best practices whether using gem or using javacsript?
The gems that you mention will be using javascript internally. In the original question you said that you want to use neither a gem nor javascript. Otherwise carmen-rails (github.com/jim/carmen-rails) is a very good gem for the purpose, much better than re-inventing the wheel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.