The simple answer is "with JavaScript". 

If you are filling that DIV with the result of a normal RESTful route, like 
/widgets/2 (show) then you can do something like this:

        $('widget_id_picker_dom_id').observe('change', function(evt){
                new Ajax.Updater('div_to_update', '/widgets/' + $F(this), { 
method: 'get });
        });

That's Prototype.js code, I am sure there is something similar in jQuery.

If you need a separate route for this job, then you can add that in your 
controller and routes.rb files, and have a more complex workflow if that is 
warranted.

Walter

On Jun 10, 2013, at 6:55 AM, Praveen BK wrote:

> How can I refresh a particular div or a partial using onChange of a
> dropdown menu without reloading the page?
> 
> -- 
> 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 unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/b3b5bf9452e5197a44f7861b9e03b50b%40ruby-forum.com?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/4B9B1482-2A31-416E-ACBD-52203B3DCCF8%40wdstudio.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to