Wednesday, February 29, 2012

[Rails] Re: Re: If photo field blank then?

Walter Davis wrote in post #1049473:
> On Feb 29, 2012, at 10:04 AM, Christopher Jones wrote:
>
>>
>> <%= image_tag user.user_photo, :height => 50, :width => 50 %>
>>
>> I don't know what is stopping it from displaying the guest.png because
>> if I changed the line to photo.url.blank? then it will display the
>> guest.png for every user but with the present or simply photo.url line
>> it just doesn't display the guest.png for any of them.
>
> Could you put just this in your view (replacing your current image tag):
>
> <%= user.user_photo %>
>
> And see what prints out in the browser. My guess is that it will be
> something, but I don't know what that is. Also, are you seeing any
> errors in the console when you test this locally?
>
> Walter

Hey Walter, good shout.

I just checked my console and I see this for the images section for
those users who don't have an image:


Started GET "/photos/original/missing.png" for 127.0.0.1 at 2012-02-29
15:29:16 +0000

ActionController::RoutingError (No route matches [GET]
"/photos/original/missing.png"):

I don't know where it is getting that line from.

Thanks

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate