title: How to mask rails controller completely?
body: <p>I have a very simple question to ask. How do I mask the controller in my url? I want this so that I can show a clean domain whether the user is logged in or not (different controller). </p>
  
  <p>My routes.rb</p>
  
  <pre><code>  root :to =&gt; "users#index"
    get 'home', to: 'home#index'
  </code></pre>
  
  <p>My Users_controller.rb</p>
  
  <pre><code>class UsersController &lt; ApplicationController    
    def index
      #@users = User.all
      if session[:user_id]
        ...
      else
        redirect_to '/home'
      end
    end
  end
  </code></pre>
  
  <p>Currently, if the user is logged in, the root_path is <a href="http://www.mydomain.com" rel="nofollow">http://www.mydomain.com</a> (that's good!).</p>
  
  <p>But, if the user is not logged in, the root_path is <a href="http://www.mydomain.com/home" rel="nofollow">http://www.mydomain.com/home</a>. I want the '/home' removed.</p>