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


#1

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


#2

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


#3

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


removed_email_address@domain.invalid
edwardfrederick.com