I asked about this before but perhaps didn’t state clearly what it was
I wanted.
I have a select box and based on the user’s choice a second select
would be populated that relates to the choice made in the first box.
I’ve googled around and found little on dependent drop downs for
rails. Kind of surprises me since I’d think it would be a more
common function. Can anyone point me in the direction ?
Just search back on this forum, there have been about 4 or 5 posts and
replies about this in in the past couple of weeks. I posted one of the
replies so its deffinitely there.
regards
c
As I’m reading through the AJAX stuff (in AWDWR) I’m wondering about a
few things
If I have this one element in my form where when user picks option
from another element is loaded - is this more of a javascript coding ,
like “onclick” or something that could be done with what’s available
within Rails.
One idea is I’m having is to have that section of my form as a partial
that will get triggered in the controller to update. This make sense
?
It’s quite easy do that with the prototype helpers. Just use an
observe of some element that calls a method in your controller, which
in its turn will update a div on your page with a partial. Or you
could look at the UJS plugin, I found it most useful as your view is
a lot cleaner than when using the built-in methods.
As I’m reading through the AJAX stuff (in AWDWR) I’m wondering about a
few things
If I have this one element in my form where when user picks option
from another element is loaded - is this more of a javascript coding ,
like “onclick” or something that could be done with what’s available
within Rails.
One idea is I’m having is to have that section of my form as a partial
that will get triggered in the controller to update. This make sense
?
Stuart
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.