Hello,
Here is a problem, probably with a silly solution, but I have been
pulling my hairs on it. Newbie...
I am in the viewer show of a block ( building ) and I want to have a
listing of its appartments with a link_to on each.
This is what I thought of at first, untill re-engeneering everything
to its right place. But the fact is that it doesn''t even work: as for
an appartment, I only get a ''#'' as an output, each.
<% Appartment.find_by_sql(["SELECT * FROM appartments WHERE
block_id = ? order by room", @block.id ]).each { |a| link_to
a.room, :controller => ''appartment'', :action =>
''show'', :id => a.id }
%>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
von.gauthier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-11 05:17 UTC
Re: Wrong output
Found it! :) On Apr 10, 4:30 pm, "von.gauth...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <von.gauth...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > Here is a problem, probably with a silly solution, but I have been > pulling my hairs on it. Newbie... > > I am in the viewer show of a block ( building ) and I want to have a > listing of its appartments with a link_to on each. > > This is what I thought of at first, untill re-engeneering everything > to its right place. But the fact is that it doesn''t even work: as for > an appartment, I only get a ''#'' as an output, each. > > <%> Appartment.find_by_sql(["SELECT * FROM appartments WHERE > block_id = ? order by room", @block.id ]).each { |a| link_to > a.room, :controller => ''appartment'', :action => ''show'', :id => a.id } > > %>--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---