Displaying 2 results from an estimated 2 matches for "find_all_by_subject".
2007 Jan 15
2
Help with with displaying a selected list.
Hello. I call a find_all_by_subject("action") which returns 2 videos
and displays them properly. But when I add @video_pages, @videos =
paginate :videos, :per_page => 10 so I can paginate the videos, it
displays ALL the videos as if I selected list videos. Can someone
please tell me what I am doing wrong? Thank you.
sel...
2006 Mar 02
0
Select from Many to Many
...t;%= c.id %>" <% if @resource.core_contents.include?
(c) %> selected="selected"<% end %>>
<%= c.code %>
</option>
<% end %>
</select>
<br/>
admin_controller.rb:
def add_core_content
@core_contents = CoreContent.find_all_by_subject(@params["subject"],
:order => ''level ASC'')
end
Everything works fine if I don''t have:
<% if @resource.core_contents.include? (c) %> selected="selected"<% end
%>
But when that is included I get an error:
You have a nil objec...