The problem that I am facing with my :before_filter action is that,
-
I need to allow a non-registered user to access the purchase page (0.0.0.0:3000/purchase) without signing into the site.This I accomplished with the bellow code in my Customer controller function like bellow and it workes:
Customer_controller.rb class CustomersController < ApplicationController before_filter :authenticate_user!, :except => [:purchases] before_action :set_menu . . end
The problem now is that, from the "0.0.0.0:3000/purchase" on submit should be redirected to 0.0.0.0:3000/paymentpage after creating the purchase.
But on submitting from the purchase page it is then redirected to login page without going into payment page. How to allow the redirection to payment page without login ? I have tried the bellow by updating my code like bellow and it workes:
before_filter :authenticate_user!, :except => [:purchases, :paymnets]
But the problem is that, Now the payment page is also directly accessible.
So how to allow the nesting of allowing the continuation of my workflow from one method to another method without going to check the befor_filter :authenticate_user! all the time, once if the user started his work from an accessible method defined in the before_filter :authenticate_user!, :except => [:method_name].
Aucun commentaire:
Enregistrer un commentaire