While working in an assignment, I have to dealt with view where I have to re-send the verification code form the same view in which I have to accept the verification code.

As shown in the image, “Confirm” and “Resend code” both are 2 submit buttons. I need to resend another code from the same page without redirecting.
How I made it work ??
View part
Added both the submit buttons
|
<%= f.submit "Resend Code", :name=>"resend_code" %> <%= f.submit "Confirm" %> |
Controller part
Handled the post action part
|
if params[:resend_code] # code to handle code generation and resend # redirect to the same page else # code to handle confirm functionality end |
Like this:
Like Loading...
Categories: Ruby On Rails