Created
August 9, 2008 01:35
-
-
Save piclez/4645 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODEL: | |
class Gallery | |
include DataMapper::Resource | |
belongs_to :user | |
has n, :photos | |
def thumbnail | |
"1" | |
end | |
end | |
CONTROLLER: | |
def index | |
#@galleries = User.first(:login => params[:login]).galleries # This doesn't work! DM bug? | |
@galleries = Gallery.all # This works! | |
display @galleries | |
end | |
VIEW: | |
<%= partial 'galleries', :with => @galleries %> | |
PARTIAL: | |
<%= galleries.thumbnail %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment