From ea3e37247419400a933b87209bfef64698516b84 Mon Sep 17 00:00:00 2001 From: Daniel Vincent Grippi Date: Wed, 15 Sep 2010 11:24:23 -0700 Subject: [PATCH] fixed 500 error with @photos --- app/views/users/edit.html.haml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index bd786505e..3086eb999 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -17,18 +17,28 @@ %h3 Picture %div#image_picker - = p.hidden_field :image_url, :value => @profile.image_url.sub(@user.url,'/'), :id => 'image_url_field' - - for photo in @photos - - if photo.url(:thumb_medium) == @profile.image_url.sub(@user.url,'/') - %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} - = check_box_tag 'checked_photo', true, true - = link_to image_tag(photo.url(:thumb_medium)), "#" - - else - %div.small_photo{:id => photo.url(:thumb_medium)} - = check_box_tag 'checked_photo' - = link_to image_tag(photo.url(:thumb_medium)), "#" + = p.hidden_field :image_url, :value => (@profile.image_url.sub(@user.url,'/') if @profile.image_url), :id => 'image_url_field' + + - unless @photos.nil? || @photos.empty? + - for photo in @photos + - if photo.url(:thumb_medium) == @profile.image_url.sub(@user.url,'/') + %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} + = check_box_tag 'checked_photo', true, true + = link_to image_tag(photo.url(:thumb_medium)), "#" + - else + %div.small_photo{:id => photo.url(:thumb_medium)} + = check_box_tag 'checked_photo' + = link_to image_tag(photo.url(:thumb_medium)), "#" + + - else + You don't have any photos! Go to the + = link_to "albums", albums_path + page to upload some. + =will_paginate @photos + %br + %h3 Info %p