修改了讨论区bug
This commit is contained in:
parent
838894a19c
commit
b6ca2c3d74
|
@ -42,6 +42,7 @@ class BoardsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
sort_init 'updated_on', 'desc'
|
sort_init 'updated_on', 'desc'
|
||||||
|
@ -60,7 +61,7 @@ class BoardsController < ApplicationController
|
||||||
preload(:author, {:last_reply => :author}).
|
preload(:author, {:last_reply => :author}).
|
||||||
all
|
all
|
||||||
@message = Message.new(:board => @board)
|
@message = Message.new(:board => @board)
|
||||||
if @project.project_type
|
if @project.project_type ==1
|
||||||
render :action => 'show', :layout => 'base_courses'
|
render :action => 'show', :layout => 'base_courses'
|
||||||
else
|
else
|
||||||
render :action => 'show', :layout => !request.xhr?
|
render :action => 'show', :layout => !request.xhr?
|
||||||
|
@ -80,7 +81,7 @@ class BoardsController < ApplicationController
|
||||||
def new
|
def new
|
||||||
@board = @project.boards.build
|
@board = @project.boards.build
|
||||||
@board.safe_attributes = params[:board]
|
@board.safe_attributes = params[:board]
|
||||||
if @project.project_type
|
if @project.project_type == 1
|
||||||
render :layout => 'base_courses'
|
render :layout => 'base_courses'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -88,6 +89,9 @@ class BoardsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@board = @project.boards.build
|
@board = @project.boards.build
|
||||||
@board.safe_attributes = params[:board]
|
@board.safe_attributes = params[:board]
|
||||||
|
if @project.project_type == 1
|
||||||
|
render :layout => 'base_courses'
|
||||||
|
end
|
||||||
if @board.save
|
if @board.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
#Modified by young
|
#Modified by young
|
||||||
|
@ -103,7 +107,7 @@ class BoardsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @project.project_type
|
if @project.project_type ==1
|
||||||
render :layout => 'base_courses'
|
render :layout => 'base_courses'
|
||||||
end
|
end
|
||||||
@board.safe_attributes = params[:board]
|
@board.safe_attributes = params[:board]
|
||||||
|
|
Loading…
Reference in New Issue