Rjs template: reload div

Hi,

I’d like to use AJAX to reload a single div containing content
delivered by a partial. In my rjs template I thus wrote:

page[:my_div].reload

Can I tell Rails where to look for the content that it shall
regenerate? Rails automatically seems to look for the partial
“_my_div.erb” located in the same directory as the rjs template, but
in my case the partial isn’t in the same directory.

Is there sth like a :partial => “/my_folder/_partial” option I can
pass to the reload method?

Btw is there a good documentation about rjs templates anywhere on the
web?

Best regards & thanks many times for your help!

Hi

page[:my_div].reload is equivalent to

page[:my_div].replace :partial => “my_div”

So why can’t you use
page[:my_div].replace :partial => “/my_folder/some_partial”

Sijo

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