加入课程报403

This commit is contained in:
cxt 2016-06-24 18:43:12 +08:00
parent 0d66763026
commit b5c9156c10
1 changed files with 1 additions and 1 deletions

View File

@ -749,7 +749,7 @@ module CoursesHelper
if user.logged? if user.logged?
joined = course.members.includes(:user).map{|member| member.user_id}.include? user.id joined = course.members.includes(:user).map{|member| member.user_id}.include? user.id
text = joined ? l(:label_course_exit_student) : l(:label_course_join_student) text = joined ? l(:label_course_exit_student) : l(:label_course_join_student)
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) url = joined ? course_path(course.id) : try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post' method = joined ? 'delete' : 'post'
if joined if joined
link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) link = link_to(text, url, :remote => true, :method => method, :class => "pr_join_a", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))