Forum: Ruby on Rails page.replace_html "#{var_containing_id_name}", :partial => '

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jason T. (Guest)
on 2006-04-07 20:30
(Received via mailing list)
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
Jeff C. (Guest)
on 2006-04-07 20:56
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
Edward F. (Guest)
on 2006-04-08 05:25
(Received via mailing list)
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
This topic is locked and can not be replied to.