filter by categories added
This commit is contained in:
parent
5d72beeb80
commit
5afc74cb83
|
@ -2,7 +2,7 @@ class HpsLearningsController < ApplicationController
|
|||
def index
|
||||
table_fields = ["hps_learning.course_pic", "hps_learning.title", :category, "hps_learning.runtime", "hps_learning.lectures"].collect{|x| {"head" => t(x.to_sym)}}
|
||||
classes = []
|
||||
HpsClass.all.desc(:created_at).each do |hpsclass|
|
||||
HpsClass.filter_by_categories.desc(:created_at).each do |hpsclass|
|
||||
if hpsclass.hps_lectures.count > 0
|
||||
thumb = hpsclass.course_pic.thumb.url.nil? ? "http://www.placehold.it/150x150/EFEFEF/AAAAAA" : hpsclass.course_pic.thumb.url
|
||||
classes << {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<% if !clas.course_pic.url.nil? %>
|
||||
<td><img width="150px" src="<%= clas.course_pic.thumb.url %>" /></td>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<td><img src="http://www.placehold.it/150x150/EFEFEF/AAAAAA" width="150px"></td>
|
||||
<% end %>
|
||||
<td>
|
||||
<a href="<%= admin_hps_learning_path(clas.id, :page => params[:page]) %>"> <%= clas.title %> </a>
|
||||
|
|
Loading…
Reference in New Issue