This commit is contained in:
yuanke 2016-10-09 16:00:41 +08:00
parent 85e0a1df67
commit c4de8cf948
2 changed files with 4 additions and 0 deletions

View File

@ -184,6 +184,8 @@ class WelcomeController < ApplicationController
@users = User.search(@name).page(params[:page] || 1).per(20) @users = User.search(@name).page(params[:page] || 1).per(20)
when 'syllabus' when 'syllabus'
@syllabuses = Syllabus.search(@name).page(params[:page] || 1).per(20) @syllabuses = Syllabus.search(@name).page(params[:page] || 1).per(20)
logger.info "input_syllabus"
logger.info @syllabuses[0]
when 'project' when 'project'
@projects = Project.search(@name).page(params[:page] || 1).per(20).results @projects = Project.search(@name).page(params[:page] || 1).per(20).results
when 'course' when 'course'

View File

@ -26,6 +26,8 @@
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<% when 'syllabus'%> <% when 'syllabus'%>
<% logger.info "input_item" %>
<% logger.info item %>
<ul class="searchContent w968"> <ul class="searchContent w968">
<li class="f16 mb5 fontGrey3"> <li class="f16 mb5 fontGrey3">
<a href="<%= syllabus_path(item.id)%>" class="fontGrey3 fl"><%= item.try(:highlight).try(:title) ? item.highlight.title[0].html_safe : item.title %>课程</a> <a href="<%= syllabus_path(item.id)%>" class="fontGrey3 fl"><%= item.try(:highlight).try(:title) ? item.highlight.title[0].html_safe : item.title %>课程</a>