fixed 500 error with @photos
This commit is contained in:
parent
5d0f315793
commit
ea3e372474
1 changed files with 20 additions and 10 deletions
|
|
@ -17,18 +17,28 @@
|
||||||
|
|
||||||
%h3 Picture
|
%h3 Picture
|
||||||
%div#image_picker
|
%div#image_picker
|
||||||
= p.hidden_field :image_url, :value => @profile.image_url.sub(@user.url,'/'), :id => 'image_url_field'
|
= p.hidden_field :image_url, :value => (@profile.image_url.sub(@user.url,'/') if @profile.image_url), :id => 'image_url_field'
|
||||||
- for photo in @photos
|
|
||||||
- if photo.url(:thumb_medium) == @profile.image_url.sub(@user.url,'/')
|
- unless @photos.nil? || @photos.empty?
|
||||||
%div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'}
|
- for photo in @photos
|
||||||
= check_box_tag 'checked_photo', true, true
|
- if photo.url(:thumb_medium) == @profile.image_url.sub(@user.url,'/')
|
||||||
= link_to image_tag(photo.url(:thumb_medium)), "#"
|
%div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'}
|
||||||
- else
|
= check_box_tag 'checked_photo', true, true
|
||||||
%div.small_photo{:id => photo.url(:thumb_medium)}
|
= link_to image_tag(photo.url(:thumb_medium)), "#"
|
||||||
= check_box_tag 'checked_photo'
|
- else
|
||||||
= link_to image_tag(photo.url(:thumb_medium)), "#"
|
%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
|
=will_paginate @photos
|
||||||
|
|
||||||
|
%br
|
||||||
|
|
||||||
%h3 Info
|
%h3 Info
|
||||||
|
|
||||||
%p
|
%p
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue