diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index a01bba913..086ecfb7f 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -42,7 +42,11 @@ class AdminController < ApplicationController end def courses - + @name = params[:name] + @courses = Course.like(@name) + respond_to do |format| + format.html + end end def users diff --git a/app/views/admin/courses.html.erb b/app/views/admin/courses.html.erb index d1d06ad36..1615bccbc 100644 --- a/app/views/admin/courses.html.erb +++ b/app/views/admin/courses.html.erb @@ -1 +1,76 @@ -1111 \ No newline at end of file +
+ 序号 + | ++ 课程 + | ++ 主讲老师 + | ++ 学时 + | ++ <%=l(:field_is_public)%> + | ++ <%=l(:field_created_on)%> + | +
---|---|---|---|---|---|
+ <%= course.id %> + | + ++ <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> + | ++ <%= course.class_period %> + | ++ <%= checked_image course.is_public? %> + | ++ <%= format_date(course.created_at) %> + | +