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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 September 2010 07:57, PalaniKannan K <kpalanikannan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 23 September 2010 07:57, PalaniKannan K <kpalanikannan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > 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 > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- With Regards Palani Kannan. K -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sep 23, 3:52 am, PalaniKannan K <kpalanikan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dear Jeff, Thank you very much... Excellent. On 27 September 2010 07:59, JeffV <jeff.h.vance-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Sep 23, 3:52 am, PalaniKannan K <kpalanikan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- With Regards Palani Kannan. K -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ryan Bates 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 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.