Hello All, I have a link_to function for a link as follows <%=link_to "Reply" ,{},:href=>"#",:class => "replyMessage noBackgroundImage" ,:title =>"Click here to reply",:onclick => "popup(''popUpDiv_reply'');showName(''<%= h message.chid %>'',''channeltopost'');"%> When I try to run the file with the onclick as defined above,I get the following error syntax error, unexpected tRPAREN Is there a way to fix it? Thanks in Advance Regards Chandrika -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What does the generated source code look like? I''m guessing the value of "message.chid" might be messing up the HTML. Also, have you considered using "link_to_function" instead of using "link_to". Might clean up your code a little bit.* * -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Phil On Thu, Mar 10, 2011 at 5:22 AM, Chandu80 <chandu.shenoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello All, > I have a link_to function for a link as follows > > <%=link_to "Reply" ,{},:href=>"#",:class => "replyMessage > noBackgroundImage" ,:title =>"Click here to reply",:onclick => > "popup(''popUpDiv_reply'');showName(''<%= h message.chid > %>'',''channeltopost'');"%> > >You don''t need to (and probably can''t) nest erb tags <% %>... in your onclick, you could just do: :onclick => "popup(''popUpDiv_reply'');showName(''#{h message.chid}'',''channeltopost'');"> When I try to run the file with the onclick as defined above,I get the > following error > syntax error, unexpected tRPAREN > > Is there a way to fix it? > > Thanks in Advance > > > Regards > Chandrika > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Tim, Sorry for the late reply. Yes the message.chid was causing the problem. Thanks for the response. Regards Chandrika On Mar 10, 5:41 pm, Tim Shaffer <timshaf...-BUHhN+a2lJ4@public.gmane.org> wrote:> What does the generated source code look like? I''m guessing the value of > "message.chid" might be messing up the HTML. > > Also, have you considered using "link_to_function" instead of using > "link_to". Might clean up your code a little bit.* > *-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.