hi. i want do call my js method "appear(box1, box2)" with rails created, dynamic ids for my div tags --> :complete => "appear(''<%= dom_id(person.id)box %>'',''<%dom_id(person.id) %>'')" %> ...unfortunatly, that doesn''t work: syntax error, unexpected $end, expecting '')'' and so on. how has the js call to look like? i hope u r able to help me. here s the code snippet: <% unless person.about == "" %> <%= link_to_remote "mehr", :url=>{:action => "showMore"}, :update => dom_id(person.id), :complete => "appear(''<%= dom_id(person.id)box %>'',''<%dom_id(person.id) %>'')" %> <% end %> <div id="<%= dom_id(person.id) %>box"> <div id="<%= dom_id(person.id) %>"></div> </div> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-23 10:39 UTC
Re: js call with rails generated attributes (item ids)
On 23 Apr 2008, at 11:34, Claus Stachl wrote:> > hi. i want do call my js method "appear(box1, box2)" with rails > created, > dynamic ids for my div tags --> > > :complete => "appear(''<%= dom_id(person.id)box %>'',''<%> dom_id(person.id) %>'')" %>that string is just a string (ie it''s not put through erb) "appear(''#{dom_id(person.id)}box'',''#{dom_id(person.id)'')" should do the trick Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> "appear(''#{dom_id(person.id)}box'',''#{dom_id(person.id)'')" > > should do the trickthanx a lot. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 23 Apr 2008, at 11:34, Claus Stachl wrote: > >> >> hi. i want do call my js method "appear(box1, box2)" with rails >> created, >> dynamic ids for my div tags --> >> >> :complete => "appear(''<%= dom_id(person.id)box %>'',''<%>> dom_id(person.id) %>'')" %> > > that string is just a string (ie it''s not put through erb) > "appear(''#{dom_id(person.id)}box'',''#{dom_id(person.id)'')" > > should do the trick >sorry for disturbing again: now the produced html code is ok, but my script isn''t called. i use this script on an other site, thus i''m sure the script is ok. can u think about a reason for that problem. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-23 12:54 UTC
Re: js call with rails generated attributes (item ids)
On 23 Apr 2008, at 13:52, Claus Stachl wrote:> > Frederick Cheung wrote: >> On 23 Apr 2008, at 11:34, Claus Stachl wrote: >> >>> >>> hi. i want do call my js method "appear(box1, box2)" with rails >>> created, >>> dynamic ids for my div tags --> >>> >>> :complete => "appear(''<%= dom_id(person.id)box %>'',''<%>>> dom_id(person.id) %>'')" %> >> >> that string is just a string (ie it''s not put through erb) >> "appear(''#{dom_id(person.id)}box'',''#{dom_id(person.id)'')" >> >> should do the trick >> > > > sorry for disturbing again: now the produced html code is ok, but my > script isn''t called. i use this script on an other site, thus i''m > sure > the script is ok. can u think about a reason for that problem.Use firebug to see what''s going on (eg set a breakpoint in your appear function). Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---