Page.replace_html "#{var_containing_id_name}", :partial => '

The subject line says it all. – Is there a way to do something like:

page.replace_html “#{var_containing_id_name}”, :partial => ‘edit’

That line of code does not work, but I would like to pass the name of
a variable to page.replace_html. This variable would contain the id
of the div I want to update.

Anyone know if/how I could do that?

Thanks!

: )

Jason

Jason T. wrote:

The subject line says it all. – Is there a way to do something like:

page.replace_html “#{var_containing_id_name}”, :partial => ‘edit’

That line of code does not work, but I would like to pass the name of
a variable to page.replace_html. This variable would contain the id
of the div I want to update.

Anyone know if/how I could do that?

Thanks!

: )

Jason

Convert the string with the ID name to a symbol?

page.replace_html var_containing_id_name.to_sym, :partial => ‘edit’

perhaps?

Jeff

Jason,

What do you mean ‘doesn’t work’? There is no effect? An exception is
raised?

Are you using the :update option for your remote link helper? If so,
drop that.

A simple way to troubleshoot is to call the action in your browser and
see if the javascript being generated by RJS looks right.

Cheers,

Eddie


[email protected]