Ruby on Rails Wednesday, February 7, 2018

On 7 February 2018 at 17:19, fugee ohu <fugee279@gmail.com> wrote:
 
 I dunno why this doesn't produce any output

    <% @pictures=Picture.all %>

Model.all has been deprecated since rails 2.3.8.  Don't use it.
 
    <% @pictures.all do |picture| %>

this should be using each, not all

Colin
 
<% if @person %>
<% if picture.person_id == @person.id %>
<%= check_box_tag 'person[picture_ids][]', picture.id, true %>
<% else %>
   <%= check_box_tag 'person[picture_ids][]', picture.id %>
<% end %>
<%= image_tag picture.name.thumb %> 
<% end %> 
    <% end %>



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuTV3Y5pGuo-V2YeiYtOaS-9BoqZoVDtveg4GHCyy%2BHbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment