i cant seem to get the string conversion correct....any help would be great! <%if @viewobj != nil%> <% for replay in @viewobj %> <%= link_to_remote( "get description", :update => ''desc_div''+replay.id.to_s, :loaded => "new Effect.toggle(desc_div" + replay.id.to_s + ")", :url =>{:action => :get_desc, :id => replay.id })%> <div id=''desc_div''<%i.to_s%>> </div> <%end%> <%end%> -- 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 -~----------~----~----~----~------~----~------~--~---
hi i got it to work with this... by converting the div string <% s = "<div id=desc_div#{i.to_s}> </div>"%> <%= s %> now my next problem seems that i click once, the description appears and then disappears, when click again, it works fine. any idea? -- 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 -~----------~----~----~----~------~----~------~--~---
koloa wrote:> <div id=''desc_div''<%i.to_s%>> </div>Try: <div id=''desc_div<%i.to_s%>''> </div> I moved your tick over. And this is better: <div id=''desc_div_<%i.to_s%>''> </div>> hi i got it to work with this... > > by converting the div string > > <% s = "<div id=desc_div#{i.to_s}> </div>"%> > <%= s %>And that creates (relatively) ill-formed HTML. I''m aware that HTML is often "anything goes", but you don''t have quotes around the id=desc_div2. I always feel safer with id=''desc_div2'', because many more things besides web browsers should read my HTML. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
koloa wrote:> <%= link_to_remote( "get description", > :update => ''desc_div''+replay.id.to_s, > :loaded => "new Effect.toggle(desc_div" + > replay.id.to_s + ")",When programming the stack of languages we call The Web, you need to keep track of which language you are in at all times, at the level of all symbols. When you type a Ruby string like "new Effect.toggle(desc_div)", it passes to JavaScript as: new Effect.toggle(desc_div) JavaScript needs to see this: new Effect.toggle(''desc_div'') Add more '' '' to your expression. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hi Phlip, THANKS! -- 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 -~----------~----~----~----~------~----~------~--~---