Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 %>
Add Comment
Please, Sign In to add comment