I have this
class Pic < ActiveRecord::Base
def self.active_pics
find(:all, :conditions => [“thumbnail is NULL AND active = 1”])
end
end
in my pic.rb model file.
I have an area on my site which uses a different layout file
(pic.html.erb). Within the layout file I render a special partial
(_pics_nav.html.erb):
<% for pic in @pics %>
<%= pic.description %>
<% end %>
So I get a nil object.
Where tu put this code so I have access within every layout file and
every partial?
Thanx
–
Jochen K.