|
|
|
@ -60,11 +60,11 @@ class MemosController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
@forum.save
|
|
|
|
|
|
|
|
|
|
format.html { redirect_to forum_memo_path(@memo.forum_id, @back_memo_id), notice: 'Memo was successfully created.' }
|
|
|
|
|
format.html { redirect_to forum_memo_path(@memo.forum_id, @back_memo_id), notice: "#{l :label_memo_create_succ}" }
|
|
|
|
|
format.json { render json: @memo, status: :created, location: @memo }
|
|
|
|
|
else
|
|
|
|
|
back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id)
|
|
|
|
|
format.html { redirect_to back_error_page, notice: 'Memo was failed created.' }
|
|
|
|
|
format.html { redirect_to back_error_page, notice: "#{l :label_memo_create_fail}" }
|
|
|
|
|
format.json { render json: @memo.errors, status: :unprocessable_entity }
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -104,7 +104,7 @@ class MemosController < ApplicationController
|
|
|
|
|
if(@memo.update_attribute(:subject, params[:memo][:subject]) &&
|
|
|
|
|
@memo.update_attribute(:content, params[:memo][:content]))
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.html {redirect_to forum_memo_path(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)), notice: 'Memo was successfully updated.'}
|
|
|
|
|
format.html {redirect_to forum_memo_path(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)), notice: "#{l :label_memo_create_succ}"}
|
|
|
|
|
#format.html redirect_to forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)), notice: 'Memo was successfully updated.'
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|