修复加入课程报错的BUG
This commit is contained in:
parent
3a48034fca
commit
bf49f46b22
|
@ -26,7 +26,7 @@ class CoursesController < ApplicationController
|
||||||
def join
|
def join
|
||||||
if User.current.logged?
|
if User.current.logged?
|
||||||
course = Course.find_by_id params[:object_id]
|
course = Course.find_by_id params[:object_id]
|
||||||
if course
|
unless course
|
||||||
@state = 4
|
@state = 4
|
||||||
else
|
else
|
||||||
unless (allow_join(course) && User.current.member_of_course?(course))
|
unless (allow_join(course) && User.current.member_of_course?(course))
|
||||||
|
|
|
@ -1,11 +1,19 @@
|
||||||
<% if User.current.id == @user.id %>
|
<% if User.current.id == @user.id %>
|
||||||
<div class="menu-div">
|
<div class="menu-div">
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<span style="color: #000; font-weight: bold;"><%= "#{@user.name}的动态" %></span>
|
<span style="color: #000; font-weight: bold;">
|
||||||
|
<%= "#{@user.name}的动态" %>
|
||||||
|
</span>
|
||||||
<ul><%#链接绑定在页面最下方的jQuery%>
|
<ul><%#链接绑定在页面最下方的jQuery%>
|
||||||
<li mode='all' class="<%= "on" if @state.eql?(0) %>"><%= l :label_user_all_activity %></li>
|
<li mode='all' class="<%= "on" if @state.eql?(0) %>">
|
||||||
<li mode='myself' class="<%= "on" if @state.eql?(1) %>"><%= l :label_user_activity_myself %></li>
|
<%= l :label_user_all_activity %>
|
||||||
<li mode='respond' class="<%= "on" if @state.eql?(2) %>"><%= l :label_user_all_respond %></li>
|
</li>
|
||||||
|
<li mode='myself' class="<%= "on" if @state.eql?(1) %>">
|
||||||
|
<%= l :label_user_activity_myself %>
|
||||||
|
</li>
|
||||||
|
<li mode='respond' class="<%= "on" if @state.eql?(2) %>">
|
||||||
|
<%= l :label_user_all_respond %>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -28,6 +36,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<%= render_flash_messages %>
|
||||||
<% unless @state == 2 %>
|
<% unless @state == 2 %>
|
||||||
<% unless @activity.empty? %>
|
<% unless @activity.empty? %>
|
||||||
<div id="activity">
|
<div id="activity">
|
||||||
|
|
Loading…
Reference in New Issue