From a18fa10de529208c4e264c94bb7c308481d2e1d2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 13 Jan 2015 11:44:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E8=80=81=E5=B8=88=E5=92=8C?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=98=BE=E7=A4=BA=E7=95=8C=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E5=8C=BA=E5=88=AB=202.=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=88=86=E9=A1=B5=E7=9B=B8=E5=85=B3css=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 7 ++++--- app/views/poll/index.html.erb | 22 +++++++++++----------- public/stylesheets/polls.css | 9 +++++---- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index cb01c573e..d4e2517e7 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -6,8 +6,9 @@ class PollController < ApplicationController def index if @course - @is_teacher = User.current.allowed_to?(:as_teacher,course) - @polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}") + @is_teacher = User.current.allowed_to?(:as_teacher,@course) + polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}") + @polls = paginateHelper polls,10 #分页 respond_to do |format| format.html{render :layout => 'base_courses'} end @@ -95,6 +96,6 @@ class PollController < ApplicationController end def is_course_teacher - render_403 unless(@course && User.current.allowed_to?(:as_teacher,course)) + render_403 unless(@course && User.current.allowed_to?(:as_teacher,@course)) end end \ No newline at end of file diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index 39230774b..fc36a8abf 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -24,13 +24,17 @@