title: before_action Not Running Before Edit Action
body: <p>I'd like to perform some calculations based on integer values in the database for the "User" class. (using devise.) This is working correctly on <strong>users/show.html.erb</strong>, but not on <strong>registration/edit.html.erb (localhost:3000/users/edit)</strong></p>
  
  <p>To that end, I've set up the following in <strong>users_controller.rb</strong></p>
  
  <pre><code>before_action :set_calc_vars, only: [:edit, :show]  
  
  def edit
      @user = User.find(params[:id])
  
      respond_to do |format|
          format.html # edit.html.erb
          format.xml { render :xml =&gt; @user }
      end
    end
  
  def show
      @user = User.find(params[:id])
  
      respond_to do |format|
          format.html # show.html.erb
          format.xml { render :xml =&gt; @user }
      end
  end
  
  protected
  
  
  #Sets value for calculated variables
  def set_calc_vars
  
      user_client = User.find(params[:id])
  
      @rev_left = user_client.revlimit - user_client.revused
  
  end
  </code></pre>
  
  <p>On both pages, the code to display the value of @rev_left is:</p>
  
  <pre><code>&lt;%= @rev_left %&gt;
  </code></pre>
  
  <p>I'm not certain why set_calc_vars is running on show.html.erb but not edit.html.erb. </p>
  
  <p>On show.html.erb it displays the correct integer value for the logged in user.
  On edit.html.erb is displays nothing, suggesting the value is nil.</p>
  
  <p>My routes are as follows:</p>
  
  <pre><code>devise_for :users
  resources :users, :only =&gt; [:show]
  
  root 'pages#home'
  </code></pre>