claus
April 23, 2008, 12:34pm
1
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 %>
claus
April 23, 2008, 12:40pm
2
On 23 Apr 2008, at 11:34, Claus S. 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
claus
April 23, 2008, 2:52pm
4
Frederick C. wrote:
On 23 Apr 2008, at 11:34, Claus S. 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.
claus
April 23, 2008, 2:55pm
5
On 23 Apr 2008, at 13:52, Claus S. wrote:
dom_id(person.id) %>’)" %>
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