解决注册激活页面刷新404的问题

This commit is contained in:
huang 2016-12-29 14:38:51 +08:00
parent f733e2a276
commit b57384778e
2 changed files with 22 additions and 6 deletions

View File

@ -144,8 +144,9 @@ class AccountController < ApplicationController
when '1'
#register_by_email_activation(@user)
unless @user.new_record?
flash[:notice] = l(:notice_account_register_done)
render action: 'email_valid', locals: {:mail => @user.mail}
redirect_to account_email_valid_path(:mail => @user.mail, :user_id => @user.id)
# flash[:notice] = l(:notice_account_register_done)
# render action: 'email_valid', locals: {:mail => @user.mail}
end
when '3'
#register_automatically(@user)
@ -244,6 +245,12 @@ class AccountController < ApplicationController
end
def email_valid
begin
@mail_type = params[:mail].split("@")[1]
@user = User.find(params[:user_id])
rescue
return render_404
end
respond_to do |format|
format.html { render :layout => "base_mail"}
format.js

View File

@ -19,13 +19,11 @@ class ForumsController < ApplicationController
#@memo.forum_id = "1"
#@memo.author_id = User.current.id
#@forum = @memo.forum
@type = params[:type]
cs = CommentService.new
@memo,message = cs.create_feedback params,User.current
respond_to do |format|
if !@memo.new_record?
format.html { redirect_to forum_path(@memo.forum) }
format.js
else
sort_init 'updated_at', 'desc'
sort_update 'created_at' => "#{Memo.table_name}.created_at",
@ -51,8 +49,19 @@ class ForumsController < ApplicationController
end
else
respond_to do |format|
format.html { redirect_to signin_path }
end
format.html { redirect_to signin_path }
end
end
end
def mail_feedback
@user = User.where(:id => params[:user_id]).first
unless @user.nil?
cs = CommentService.new
@memo, message = cs.create_feedback params, @user
end
respond_to do |format|
format.js
end
end