title: What does redirecting to an instance mean in Ruby on Rails
body: <p>What does  redirecting to a particular instance mean? I am aware of how the redirecting works.</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
    def show
      @user = User.find(params[:id])
    end
  
    def new
      @user = User.new
    end
  
    def create
      @user = User.new(user_params)
      if @user.save
        log_in @user
        flash[:success] = "Welcome to the Sample App!"
        redirect_to @user
      else
        render 'new'
      end
    end
  
    def edit
      @user = User.find(params[:id])
    end
  
    private
  
      def user_params
        params.require(:user).permit(:name, :email, :password,
                                     :password_confirmation)
      end
  end
  </code></pre>
  
  <p>I understand the following ways of redirecting: </p>
  
  <ul>
  <li><code>redirect_to :new</code> (redirect to new method and displaying the new.html.erb file)</li>
  <li><code>redirect_to "show"</code>  (redirect to show.html.erb file or the path for show method) </li>
  </ul>
  
  <p>but what does <code>redirect_to @user</code> mean? Which method and path are we are redirecting to?</p>