解决注册激活页面刷新404的问题
This commit is contained in:
parent
f733e2a276
commit
b57384778e
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue