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?
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?
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 [email protected] wrote:
i got nil object
Posted via http://www.ruby-forum.com/.
–
Heri R.
http://sprinj.com
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
nilyou need something like
<% for object in @entries %>
<% @entry = object %>
<%= image_tag url_for_file_column(“entry”, “image”)%>
<%end%>On 11/10/06, sine serz [email protected] wrote:
i got nil object
Posted via http://www.ruby-forum.com/.–
Heri R.
http://sprinj.com
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%>
arrayif 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
nilyou need something like
<% for object in @entries %>
<% @entry = object %>
<%= image_tag url_for_file_column(“entry”, “image”)%>
<%end%>On 11/10/06, sine serz [email protected] wrote:
i got nil object
Posted via http://www.ruby-forum.com/.–
Heri R.
http://sprinj.com
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs