Ruby Forum Ruby on Rails > Ajax help

Posted by Gi Ga (giga)
on 19.08.2008 18:53
1. How can I update option in <select>-box with Ajax ?

2. How can I by clickin text-link update content of some <div> ?
Posted by Frederick Cheung (Guest)
on 19.08.2008 21:13
(Received via mailing list)
On 19 Aug 2008, at 17:53, Gi Ga wrote:

>
> 1. How can I update option in <select>-box with Ajax ?

You mean change the options in the select box ?
>
> 2. How can I by clickin text-link update content of some <div> ?

link_to_remote 'click me', :update => 'some_div', :url => {:controller
=> 'foo', :action =>'var'}

Fred
Posted by Gi Ga (giga)
on 20.08.2008 21:32
Frederick Cheung wrote:
>> 1. How can I update option in <select>-box with Ajax ?
> 
> You mean change the options in the select box ?

Yes, add / remove options in select box


>> 2. How can I by clickin text-link update content of some <div> ?
> 
> link_to_remote 'click me', :update => 'some_div', :url => {:controller
> => 'foo', :action =>'var'}


Thanks.
Posted by Frederick Cheung (Guest)
on 21.08.2008 00:42
(Received via mailing list)
On Aug 20, 8:32 pm, Gi Ga <rails-mailing-l...@andreas-s.net> wrote:
> Frederick Cheung wrote:
> >> 1. How can I update option in <select>-box with Ajax ?
>
> > You mean change the options in the select box ?
>
> Yes, add / remove options in select box

Well in theory  you could just do an ajax update that updates the
select box (ie where the action just renders the option tags).

Fred