2014/1/21 Gerardo Ramirez Quino <gramirez@dobleclick.com.co>:
> Hola soy nuevo en Rails. Tengo 3 modelos relacionados y tengo un formulario
> donde el usuario elige un país a continuación, debe elegir una ciudad que
> pertenece a ese país. ¿Cómo puedo hacer para que usted pide las ciudades de
> los países seleccionados por orden alfabético presentados previamente en el
> formulario y el usuario puede elegir los
The easiest way would be to use jQuery to create the city element in
the form after the user selects the country, which will require you to
either use jQuery to hit an internal API that sends back a JSON string
or to send out one big ass JSON string with all the information
already in it. Check out http://api.jquery.com/change/ and
http://api.jquery.com/jquery.getjson/
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAM5XQnwV4rrE%2BJB254VfjVEqrLvHJnBo%2BQuBQNCf3roVM1E3Eg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment