i have an array of entries and i want to show all images on screen
i try with
<%for entry in @entries%>
<%= image_tag url_for_file_column("entry", "image")%>
<%end%>
i got nil object
what i am doing wrong here?
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
file_column looks for the var @entry with the @ otherwise it will return nil
you need something like
<% for object in @entries %>
<% @entry = object %>
<%= image_tag url_for_file_column("entry", "image")%>
<%end%>
On 11/10/06, sine serz
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> i have an array of entries and i want to show all images on screen
>
> i try with
>
> <%for entry in @entries%>
> <%= image_tag url_for_file_column("entry",
"image")%>
> <%end%>
>
> i got nil object
>
> what i am doing wrong here?
>
>
>
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--
Heri R.
http://sprinj.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
but i tried this, still dont work, as long as it is in
<% for object in @entries%>
<% @entry = object %>
<%= image_tag url_for_file_column("entry", "image")%>
<%end%>
array
if i do like this
<%@entry = Entry.find(1)%>
<%= image_tag url_for_file_column("entry", "image")%>
it works, i really dont undrstand this
Heri R> wrote:> file_column looks for the var @entry with the @ otherwise it will return
> nil
>
> you need something like
>
> <% for object in @entries %>
> <% @entry = object %>
> <%= image_tag url_for_file_column("entry",
"image")%>
> <%end%>
>
> On 11/10/06, sine serz
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
>> i got nil object
>> Posted via http://www.ruby-forum.com/.
>>
>> >
>>
>
>
> --
> Heri R.
> http://sprinj.com
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
ok i solve the problem i got one entry without image just description in database, thats why wont work thanks again sine serz wrote:> but i tried this, still dont work, as long as it is in > <% for object in @entries%> > <% @entry = object %> > <%= image_tag url_for_file_column("entry", "image")%> > <%end%> > array > > if i do like this > <%@entry = Entry.find(1)%> > <%= image_tag url_for_file_column("entry", "image")%> > > it works, i really dont undrstand this > > > > > Heri R> wrote: >> file_column looks for the var @entry with the @ otherwise it will return >> nil >> >> you need something like >> >> <% for object in @entries %> >> <% @entry = object %> >> <%= image_tag url_for_file_column("entry", "image")%> >> <%end%> >> >> On 11/10/06, sine serz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >>> i got nil object >>> Posted via http://www.ruby-forum.com/. >>> >>> > >>> >> >> >> -- >> Heri R. >> http://sprinj.com-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---