Hi, I need to make an entire table row act as a hyperlink. In HTML, this would look like this: <tr onclick="location.href=''#''"> <td><%=h object.send(''property'') %><td> ... </tr> What is the best way of writing this in Rails? I could concatenate the elements together ''manually'', but that seems cludgey. Thanks in advance! Henry --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
<tr onclick="location.href=''<%= object_path(object) %>''"> At a guess, that is what you want. On Dec 10, 2007 11:43 AM, Henry Collingridge <henry.collingridge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I need to make an entire table row act as a hyperlink. > In HTML, this would look like this: > > <tr onclick="location.href=''#''"> > <td><%=h object.send(''property'') %><td> > ... > </tr> > > What is the best way of writing this in Rails? I could concatenate the > elements together ''manually'', but that seems cludgey. > > Thanks in advance! > > Henry > > >-- Ryan Bigg http://www.frozenplague.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ah, no, not really. I am hoping for a Railsy way to have an entire row act as a hyperlink - e.g. by using link_to. But using link_to, I can''t see how to avoid passing in a load of messy concatenation for the row. Cheers, Henry On Dec 10, 4:11 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <tr onclick="location.href=''<%= object_path(object) %>''"> > > At a guess, that is what you want. > > On Dec 10, 2007 11:43 AM, Henry Collingridge <henry.collingri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > > Hi, > > > I need to make an entire table row act as a hyperlink. > > In HTML, this would look like this: > > > <tr onclick="location.href=''#''"> > > <td><%=h object.send(''property'') %><td> > > ... > > </tr> > > > What is the best way of writing this in Rails? I could concatenate the > > elements together ''manually'', but that seems cludgey. > > > Thanks in advance! > > > Henry > > -- > Ryan Bigghttp://www.frozenplague.net--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Actually - sorry - that''s great! Cheers! On Dec 10, 4:11 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <tr onclick="location.href=''<%= object_path(object) %>''"> > > At a guess, that is what you want. > > On Dec 10, 2007 11:43 AM, Henry Collingridge <henry.collingri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > > Hi, > > > I need to make an entire table row act as a hyperlink. > > In HTML, this would look like this: > > > <tr onclick="location.href=''#''"> > > <td><%=h object.send(''property'') %><td> > > ... > > </tr> > > > What is the best way of writing this in Rails? I could concatenate the > > elements together ''manually'', but that seems cludgey. > > > Thanks in advance! > > > Henry > > -- > Ryan Bigghttp://www.frozenplague.net--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---