Not sure how to achieve this:
Yet another way of saying it using code snippets below:
Signup Controller code
def new
@signup = Signup.new
end
def create
@signup = Signup.new(signup_params)
if @signup.save
redirect_to new_request_path
else
render new_signup_path
end
end
Request Controller code
def new
@requestrecord = Request.new
end
def create
@requestrecord = Request.new(request_params)
end
You could just set the user's email in a session variable:
def create
@signup = Signup.new(signup_params)
if @signup.save
session[:user_email] = @signup.email
redirect_to new_request_path
else
render new_signup_path
end
end
and then you can use it as needed with session[:user_email]
in your Request controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.