# Loop not rendering anything

**URL:** <https://www.ruby-forum.com/t/loop-not-rendering-anything/103226>\
**Category:** Rails\
**Created:** [May 3, 2007, 4:38am UTC](https://www.ruby-forum.com/t/loop-not-rendering-anything/103226 "2007-05-03T04:38:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [May 3, 2007, 4:38am UTC](https://www.ruby-forum.com/t/loop-not-rendering-anything/103226/1 "2007-05-03T04:38:43Z")

</div>

I have a database that is reading the “show\_times” from a column in my  
database table, but nothing is showing up. Is there some sort of  
syntax error here? I thought this was working fine yesterday…

\<% @show\_times.each do |s| %\>  
  
  
\<%= link\_to s.show\_time, :controller =\> “movies”, :action =\>  
“detail”, :id =\> s %\>  
\<% end %\>

Thanks for any help ☹

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [May 3, 2007, 9:46am UTC](https://www.ruby-forum.com/t/loop-not-rendering-anything/103226/2 "2007-05-03T09:46:11Z")

</div>

Daniel Scrima wrote:

> I have a database that is reading the “show\_times” from a column in my  
> database table, but nothing is showing up. Is there some sort of  
> syntax error here? I thought this was working fine yesterday…
> 
> \<% @show\_times.each do |s| %\>  
>   
>   
> \<%= link\_to s.show\_time, :controller =\> “movies”, :action =\>  
> “detail”, :id =\> s %\>  
> \<% end %\>
> 
> Thanks for any help

Hey daniel -

if the loop isn’t rendering anything, but there is no error either - one  
of two options is the case:

either 1) @show\_times is an empty array  
# @show\_times.inspect ==\> []  
or 2) a show\_time instance with the show\_time method returns an  
empty string  
# s.show\_time =\> “”

that’s my guess.  
the best thing to do, as a first debugging step is to use #inspect -  
great debugging tool. just do:

@show\_times.inspect in the rhtml (or in the action in the controller  
do render\_text @show\_times.inspect on the last line)

and see what it comes up with. i find this very useful.  
good luck!

-shai
