Multipe Combo box Query System

Hi,

Anybody tell me, how i can implement multiple query system which is
related
hierarchically ?

Like

  1. Year,
  2. Files in that selected year.


With Regards
Palani Kannan. K

On 23 September 2010 07:57, PalaniKannan K [email protected]
wrote:

Hi,

Anybody tell me, how i can implement multiple query system which is related
hierarchically ?

Like

  1. Year,
  2. Files in that selected year.

I think you will need to be a lot more specific about your
requirement. I, for one, have little idea what you mean. If you are
just talking about related tables (has_many, belongs_to etc) then have
a look at the Rails Guide on ActiveRecord Relationships.

Colin

Dear Collin,

Sorry for failing in explaining the problem. I wish to apply like

  1. collection_select (country)
  2. collection_select (state)
  3. collection_select (city)

I need to give the query system hierarchically.

(Eg. select India -> then it should populate states in India-> select
state
tamilnadu-> it should populate cities in tamilnadu-> select madras-> It
should get all params values as params[:country], :params[:state],
:params[city]->@list = Table.find(conditions…params[:country],
:params[:state], :params[city]))

This is the exact problem I need. In tutorials, this kind of hierarchal
collection_select options are not available… If clear tutorials
available
kindly tell me… With Advanced Thanks.

On 23 September 2010 09:54, Colin L. [email protected] wrote:

  1. Files in that selected year.
    “Ruby on Rails: Talk” group.
    To post to this group, send email to [email protected]
    To unsubscribe from this group, send email to
    [email protected][email protected]
    .
    For more options, visit this group at
    http://groups.google.com/group/rubyonrails-talk?hl=en.


With Regards
Palani Kannan. K

You should look into:

http://stackoverflow.com/questions/575862/rjs-using-observe-field-on-select-tag

for info on how to use observe_field in combination with a select. I
just did a sursory review, and it looks like a decent solution
guideline.

On Sep 23, 3:52 am, PalaniKannan K [email protected] wrote:

  1. collection_select (country)
  2. collection_select (state)
  3. collection_select (city)

    (Eg. select India -> then it should populate states in India-

    You can add onchange to 1 and 2 above, eg.
    collect_select( …,
    :onchange=>
    remote_function(:url=>controllers_path, :method=>:get,
    :with=>’’
    ‘country=’+options[selectedIndex].value" ) )

where “controllers_path” is a path to an action that,

Or you could write some unobtrusive jQuery code to perform similarly.

Jeff

Ryan B. did an excellent screencast that does exactly just that:
http://railscasts.com/episodes/88-dynamic-select-menus

Supposedly this plugin does the same thing
http://github.com/splendeo/dependent_select

Haven’t tried it personally, so can’t vouch for it.

-sunny
http://ezror.com

Dear Jeff,

Thank you very much… Excellent.

On 27 September 2010 07:59, JeffV [email protected] wrote:

You can add onchange to 1 and 2 above, eg.
Jeff


With Regards
Palani Kannan. K

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs