Jason Tuttle
2006-Apr-07 16:28 UTC
[Rails] page.replace_html "#{var_containing_id_name}", :partial => ''edit''
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 Coleman
2006-Apr-07 16:57 UTC
[Rails] Re: page.replace_html "#{var_containing_id_name}", :partial
Jason Tuttle 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! > > : ) > > JasonConvert the string with the ID name to a symbol? page.replace_html var_containing_id_name.to_sym, :partial => ''edit'' perhaps? Jeff -- Posted via http://www.ruby-forum.com/.
Edward Frederick
2006-Apr-08 01:24 UTC
[Rails] page.replace_html "#{var_containing_id_name}", :partial => ''edit''
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 ---------------------------------- epfrederick@gmail.com edwardfrederick.com On 4/7/06, Jason Tuttle <jason@gothamcitymacs.com> 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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >