title: Rails 4 before_filter :authenticate_user!, :except => ["some function name"]
body: <p><strong>The problem that I am facing with my :before_filter action is that,</strong> </p>
  
  <ol>
  <li><p>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: </p>
  
  <pre><code>Customer_controller.rb
  class CustomersController &lt; ApplicationController
  
  before_filter :authenticate_user!, :except =&gt; [:purchases]
  before_action :set_menu
  
  .
  
  .
  end
  </code></pre></li>
  </ol>
  
  <p>The problem now is that, from the <strong><em>"0.0.0.0:3000/purchase"</em></strong> on submit should be redirected to <strong><em>0.0.0.0:3000/paymentpage</em></strong> after creating the purchase.</p>
  
  <p>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:</p>
  
  <pre><code>before_filter :authenticate_user!, :except =&gt; [:purchases, :payments]
  </code></pre>
  
  <p><strong>But the problem is that, Now the payment page is also directly accessible.</strong></p>
  
  <p>So how to allow the nesting of allowing the continuation of my workflow from one method to another method without going to check the <strong>befor_filter :authenticate_user!</strong> all the time, once if the user started his work from an accessible method defined in the  <strong>before_filter :authenticate_user!, :except => [:method_name]</strong>.</p>