I need som help i want tha a hole <div></div> to have a link to remote to a controllers action (yo do click on any part inside th div and the action is executed) how can i do that!! -- Felipe Vergara Contesse Ingeniería Civil Industrial UC --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Felipe Vergara wrote:> I need som help i want tha a hole <div></div> to have a link to remote > to a controllers action (yo do click on any part inside th div and the > action is executed) > how can i do that!!Put everything inside the div into a partial. Put the link_to_remote around the partial, like this: <%= link_to_remote render(:partial => ''my_partial''), :url => {...} %> I suspect you''ll get an <a> with an entire stretch of HTML inside, not just a string. Report back if the link_to_remote calls h() on the HTML! -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
i will try that thank yo very much!! On Sat, Sep 6, 2008 at 10:14 AM, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Felipe Vergara wrote: > > > I need som help i want tha a hole <div></div> to have a link to remote > > to a controllers action (yo do click on any part inside th div and the > > action is executed) > > how can i do that!! > > Put everything inside the div into a partial. Put the link_to_remote around > the > partial, like this: > > <%= link_to_remote render(:partial => ''my_partial''), :url => {...} %> > > I suspect you''ll get an <a> with an entire stretch of HTML inside, not just > a > string. Report back if the link_to_remote calls h() on the HTML! > > -- > Phlip > > > > >-- Felipe Vergara Contesse Ingeniería Civil Industrial UC --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Felipe Vergara wrote:> i will try that thank yo very much!!Oh yeah and test the living crap out of it, preferably with assert_xpath, because it''s going to be a major hazard at code upgrade time!> <%= link_to_remote render(:partial => ''my_partial''), :url => {...} %>> -- > Phlip--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
i didnt understant the assert_xpath thak you anyway i will check for information!!! On 9/6/08, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Felipe Vergara wrote: > > > i will try that thank yo very much!! > > Oh yeah and test the living crap out of it, preferably with assert_xpath, > because it''s going to be a major hazard at code upgrade time! > > > <%= link_to_remote render(:partial => ''my_partial''), :url => {...} > %> > > > -- > > Phlip > > > > >-- Felipe Vergara Contesse Ingeniería Civil Industrial UC --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Felipe Vergara wrote:> i didnt understant the assert_xpath > > > <%= link_to_remote render(:partial => ''my_partial''), :url > => {...} %>When you test that, it will produce an <a>, so capture that. First put a <div id=''clickable_div'' around the linker. Then capture it like this: assert_tag_id :div, :clickable_div do assert_xpath ''a'' do |a| assert{ a[:href] == ''#'' } puts indent_xml end end When you run that test, the puts indent_xml will spew out the contents of the partial inside the <a>. Then you can call assert_tag_id or assert_xpath, again, to find some detail inside the partial. This way, a change that looks harmless, to the <a> or the partial, has greater odds of raising a red flag instantly, while testing. -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thank you very much!! On 9/7/08, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Felipe Vergara wrote: > > i didnt understant the assert_xpath > > > > > <%= link_to_remote render(:partial => ''my_partial''), :url > > => {...} %> > > When you test that, it will produce an <a>, so capture that. First put a > <div > id=''clickable_div'' around the linker. Then capture it like this: > > assert_tag_id :div, :clickable_div do > assert_xpath ''a'' do |a| > assert{ a[:href] == ''#'' } > puts indent_xml > end > end > > When you run that test, the puts indent_xml will spew out the contents of > the > partial inside the <a>. > > Then you can call assert_tag_id or assert_xpath, again, to find some detail > inside the partial. > > This way, a change that looks harmless, to the <a> or the partial, has > greater > odds of raising a red flag instantly, while testing. > > -- > Phlip > > > > >-- Felipe Vergara Contesse Ingeniería Civil Industrial UC --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---