Re: using params in a comparison

Dave Lynam
Wed, 28 May 2008 01:36:00 -0000

Other is a column in the database.  So photo.other is the value in
this column and I only want to display the photos where the
params[:id] matches this photo.other value.

On May 27, 6:29 pm, "Ryan Bigg (Radar)"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> Obviously photo.other  does not equal params[:id]
>
> What is .other?
>
>
>
> On Wed, May 28, 2008 at 10:34 AM, Dave Lynam
<dly...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Hi, i will keep this short:
>
> > <% for photo in @photos -%>
> >    <% if photo.other == params[:id] %>
> >        <%= link_to image_tag(photo.public_filename(:thumb)) %>
> >    <% end %>
> > <% end %>
>
> > This is the code Im using and it is not displaying anything.  All the
> > values are stored correctly and params[:id] has the correct value.  I
> > think there is something wrong in the comparison: if photo.other =>
> params[:id].  Can you use the params hash to make comparisons like
> > this?
>
> > thanks.
>
> --
> Appreciated my help?
> Recommend me on Working With
Railshttp://workingwithrails.com/person/11030-ryan-bigg