title: Rails: method defined in application_helper.rb not recognized by categories_controller.rb
body: <p>More newbie issues.</p>
  
  <p>I understand that if I define a method in my application helper, it is available to the entire app code.</p>
  
  <p>In my applicaton helper, I have:</p>
  
  <pre><code>def primary_user_is_admin
  
    if current_user
      user_login_roles = JSON.parse(current_user.role)
      if user_login_roles["admin"]
        return 1
      end
    end
    return nil
  end
  </code></pre>
  
  <p>If I call it from the categories_controller:</p>
  
  <pre><code>if !primary_user_is_admin
    redirect_to root_url
  end
  </code></pre>
  
  <p>I get an error message: undefined local variable or method `primary_user_is_admin'</p>
  
  <p>This also happens if I put the primary_user_is_admin code in the registrations_helper.rb file</p>
  
  <p>However, if I use it in any of the views (views/user/edit.html.erb for instance)</p>
  
  <pre><code>&lt;% if primary_user_is_admin %&gt;
  &lt;% end &gt;
  </code></pre>
  
  <p>then it works. What am I missing?</p>