title: How to Use Sessions to walk user through Sign Up?
body: <p>On the home page:</p>
  
  <p><strong>sessions/_goal.html.erb</strong></p>
  
  <pre><code>&lt;%= simple_form_for(:session, url: new_goal_path) do |f| %&gt;
    &lt;%= f.text_field :name %&gt;
    &lt;%= f.submit %&gt;
  &lt;% end %&gt;
    # ERROR MESSAGE:
      Routing Error
      No route matches [POST] "/goals/new"
  </code></pre>
  
  <p>Once the user submit's that he should be redirected to:</p>
  
  <p><strong>sessions/_habit.html.erb</strong></p>
  
  <pre><code>&lt;%= simple_form_for(:session, url: new_habit_path) do |f| %&gt;
    &lt;%= f.text_field :name %&gt;
    &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Once the user submit's that he should be redirected to:</p>
  
  <pre><code>&lt;%= link_to "Sign Up via Facebook", "/auth/facebook" %&gt; or
  &lt;%= link_to "Sign Up via Email", signup_path %&gt;
  </code></pre>
  
  <p>The information they put in those two partials should then be stored so that when they are signed in they will see it as part of their profile.</p>
  
  <p><strong>sessions_controller.rb</strong></p>
  
  <pre><code>class SessionsController &lt; ApplicationController
  
    def new
    end
  
    def goal
    end 
  
    def facebook
      user = User.from_omniauth(env["omniauth.auth"])
      session[:user_id] = user.id
      redirect_to root_url
    end
  
    def create
      user = User.find_by(email: params[:session][:email].downcase)
      if user &amp;&amp; user.authenticate(params[:session][:password])
        if user.activated?
          log_in user
          params[:session][:remember_me] == '1' ? remember(user) : forget(user)
          redirect_to root_url
        else
          message  = "Account not activated. "
          message += "Check your email for the activation link."
          flash[:warning] = message
          redirect_to root_url
        end
      else
        flash.now[:danger] = 'Invalid email/password combination'
        render 'new'
      end
    end
  
    def destroy
      log_out if logged_in?
      redirect_to root_url
    end
  end
  </code></pre>
  
  <p><strong>routes</strong></p>
  
  <pre><code>Rails.application.routes.draw do
  
    put '/mark_completed/:id', to: 'habits#mark_completed', as: 'mark_completed'
  
    put '/mark_accomplished/:id', to: 'goals#mark_accomplished', as: 'mark_accomplished'
  
    get 'notes/index'
  
    get 'notes/new'
  
    get 'notifications/index'
  
    get 'auth/:provider/callback', to: 'sessions#facebook'
    get 'auth/failure', to: redirect('/')
    get 'signout', to: 'sessions#destroy', as: 'signout'
  
    get 'password_resets/new'
  
    get 'password_resets/edit'
  
    get "/users/:user_id/goals", to: "goals#user_goals", as: "user_goals"
  
    shallow do
      resources :habits do
        resources :comments
        resources :notes
        resources :notifications
      end
      resources :valuations do
        resources :comments
        resources :notes
        resources :notifications
      end
      resources :goals do
        resources :comments
        resources :notes
        resources :notifications
      end
      resources :stats do
        resources :comments
        resources :notes
        resources :notifications
      end
    end
  
    resources :notes
  
    resources :habits do
      collection { post :sort }
      resources :notes
      resources :notifications
      resources :comments do
        resources :likes
      end
      resources :likes
      member do
        post :like
        post :notifications
      end
      resources :levels do
        # we'll use this route to increment and decrement the missed days
        resources :days_missed, only: [:create, :destroy]
      end
    end
  
    resources :goals do
      resources :notes
      resources :comments
      member do
        post :like
      end
    end
  
    resources :valuations do
      resources :notes
      resources :comments
      resources :notifications
      member do
        post :like
        post :notifications
      end
    end
  
    resources :stats do
      resources :notes
      resources :comments
      resources :notifications
      member do
        post :like
      end
    end
  
    resources :results
  
    resources :users
  
    resources :account_activations, only: [:edit]
  
    resources :activities do
      resources :valuations
      resources :habits
      resources :stats
      resources :goals
    end
  
    resources :notifications do
      resources :valuations
      resources :habits
      resources :stats
      resources :goals
      resources :comments
    end
  
    resources :comments do
      resources :comments
      resources :notifications
      member do
        post :like
      end
    end
  
    resources :password_resets,     only: [:new, :create, :edit, :update]
  
    resources :relationships,       only: [:create, :destroy]
  
    get 'tags/:tag', to: 'pages#home', as: :tag
  
    resources :users do
      member do
        get :following, :followers
      end
    end
  
    get    'about'   =&gt; 'pages#about'
    get    'signup'  =&gt; 'users#new'
    get    'login'   =&gt; 'sessions#new'
    post   'login'   =&gt; 'sessions#create'
    delete 'logout'  =&gt; 'sessions#destroy'
  
    root 'pages#home'
  </code></pre>
  
  <p>I have no idea what I'm doing here. Any help would greatly be appreciated :]</p>