Colleen Robledo, MLIS
2008-Apr-05 04:30 UTC
Assigning Show method to a field on Index/list views
Hello, I''m still very new to learning Rails (I''m better with Grails). On the Index/List views, how can I assign he Show method to a field in the table(making that particular table field the "clickable" link to the associated Show view) , rather than display the link_to Show view as a separate text link? I know it''s something I have to set in the <td> tag for that field: <%=h table.field_name %> But I''m not quite sure how... Thank you! Colleen Robledo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try <%= link_to object.field_name, :action => ''show'', :id => object.id %>. That should give you the field text as the link to the show action for that object. -Kyle On Apr 4, 11:30 pm, "Colleen Robledo, MLIS" <colleenrobl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I''m still very new to learning Rails (I''m better with Grails). > > On the Index/List views, how can I assign he Show method to a field > in the table(making that particular table field the "clickable" link > to the associated Show view) , rather than display the link_to Show > view as a separate text link? > > I know it''s something I have to set in the <td> tag for that field: > <%=h table.field_name %> > But I''m not quite sure how... > > Thank you! > > Colleen Robledo--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Colleen Robledo, MLIS
2008-Apr-05 16:30 UTC
Re: Assigning Show method to a field on Index/list views
Thanks so much! It worked! On Apr 5, 5:52 am, Kyle <kyle.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try <%= link_to object.field_name, :action => ''show'', :id => object.id > %>. > > That should give you the field text as the link to the show action for > that object. > > -Kyle > > On Apr 4, 11:30 pm, "Colleen Robledo, MLIS" <colleenrobl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > Hello, > > > I''m still very new to learning Rails (I''m better with Grails). > > > On the Index/List views, how can I assign he Show method to a field > > in the table(making that particular table field the "clickable" link > > to the associated Show view) , rather than display the link_to Show > > view as a separate text link? > > > I know it''s something I have to set in the <td> tag for that field: > > <%=h table.field_name %> > > But I''m not quite sure how... > > > Thank you! > > > Colleen Robledo--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---