修改了讨论区bug

This commit is contained in:
huangjingquan 2013-09-29 20:04:03 +08:00
parent 838894a19c
commit b6ca2c3d74
1 changed files with 7 additions and 3 deletions

View File

@ -42,6 +42,7 @@ class BoardsController < ApplicationController
end
def show
respond_to do |format|
format.html {
sort_init 'updated_on', 'desc'
@ -60,7 +61,7 @@ class BoardsController < ApplicationController
preload(:author, {:last_reply => :author}).
all
@message = Message.new(:board => @board)
if @project.project_type
if @project.project_type ==1
render :action => 'show', :layout => 'base_courses'
else
render :action => 'show', :layout => !request.xhr?
@ -80,7 +81,7 @@ class BoardsController < ApplicationController
def new
@board = @project.boards.build
@board.safe_attributes = params[:board]
if @project.project_type
if @project.project_type == 1
render :layout => 'base_courses'
end
end
@ -88,6 +89,9 @@ class BoardsController < ApplicationController
def create
@board = @project.boards.build
@board.safe_attributes = params[:board]
if @project.project_type == 1
render :layout => 'base_courses'
end
if @board.save
flash[:notice] = l(:notice_successful_create)
#Modified by young
@ -103,7 +107,7 @@ class BoardsController < ApplicationController
end
def update
if @project.project_type
if @project.project_type ==1
render :layout => 'base_courses'
end
@board.safe_attributes = params[:board]