> My controller:
>
>
>   def index
>    @users= User.all
>
>     @users.each do |p|
>     @pic= Picture.where(:phrase_id => :route , :culture_id =>
> p.culture_id).first
>      send_data @pic.image, :type => 'image/gif', :disposition => 'inline'
>     end
> end
>
> in View
>
>   <tr width = "50%">
>  <td><%= image_tag url_for(:controller => "/users", :action => "index"),
> :width => "25px", :height => "25px"%></td>
>
> <%@pic.each do |c|%>
>   <%= c.image%>
> <% end %>
>
> error is
>
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each


Extracted source (around line #79):

76:   <tr width = "50%">
77:  <td><%= image_tag url_for(:controller => "/users", :action => "index"),
:width => "25px", :height => "25px"%></td>
78:
79: <%@pic.each do |c|%>
80:   <%= c.image%>
81: <% end %>
82:




please give me some advices..
>
>
> thanks
> Joanne
>
>
>
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to