From 07d95bdda9345c617224c7e268448555a784a638 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 1 Jul 2015 17:34:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 6 ++- app/views/admin/courses.html.erb | 77 ++++++++++++++++++++++++++++- config/locales/commons/zh.yml | 2 +- 3 files changed, 82 insertions(+), 3 deletions(-) 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) %> + | +