Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7914081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:59:49+00:00 2026-06-03T13:59:49+00:00

I am studying Ruby on rails by Michael Hartl. I am stuck at the

  • 0

I am studying Ruby on rails by Michael Hartl. I am stuck at the section 8.1.4 which is implementing a sign-in page using Rails 3.2.3 with Ruby 1.9.3-p125.

I have created a session controller, and I want my session controller’s create action maps to this route /sessions , but always a routing error. Any clues? The following are my relevant files:

routes.rb

SampleApp::Application.routes.draw do

  resources :users
  resources :sessions, only: [:new, :create, :destroy]

  root to: 'static_pages#home'

  match '/signup',  to: 'users#new'
  match '/signin',  to: 'sessions#new'
  match '/signout', to: 'sessions#destroy', via: :delete

  match '/help',    to: 'static_pages#help'
  match '/about',   to: 'static_pages#about'
  match '/contact', to: 'static_pages#contact' 
end

and my rake routes :

      users GET    /users(.:format)          users#index
            POST   /users(.:format)          users#create
   new_user GET    /users/new(.:format)      users#new
  edit_user GET    /users/:id/edit(.:format) users#edit
       user GET    /users/:id(.:format)      users#show
            PUT    /users/:id(.:format)      users#update
            DELETE /users/:id(.:format)      users#destroy
   sessions POST   /sessions(.:format)       sessions#create
new_session GET    /sessions/new(.:format)   sessions#new
    session DELETE /sessions/:id(.:format)   sessions#destroy
       root        /                         static_pages#home
     signup        /signup(.:format)         users#new
     signin        /signin(.:format)         sessions#new
    signout DELETE /signout(.:format)        sessions#destroy
       help        /help(.:format)           static_pages#help
      about        /about(.:format)          static_pages#about
    contact        /contact(.:format)        static_pages#contact

my app/views/sessions/new.html.erb :

  <%= provide(:title, 'Sign in') %>
  <h1>Sign in</h1>

 <div class="row">
 <div class="span6 offset3">
   <%= form_for(:session, url: sessions_path) do |f| %>

     <%= f.label :email %>
     <%= f.text_field :email %>

     <%= f.label :password %>
     <%= f.password_field :password %>

     <%= f.submit "Sign in", class: "btn btn-large btn-primary" %>
   <% end %>

   <p>New user? <%= link_to "Sign up now!", signup_path %></p>
 </div>

my sessions controller:

class SessionsController < ApplicationController
  def new
  end

  def create
    render 'new'
  end

  def destroy
  end
end

In figure 8.5 the picture shows the url for sign in is http://localhost:3000/sessions. When I navigate to that page,

I always get a

Routing Error
    No route matches [GET] "/sessions"

solved

The figure 8.5 is showing the page after you hit the create button, and the url changes from /sessions/new or /signin to /sessions, So it’s nothing wrong with my above files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:59:50+00:00Added an answer on June 3, 2026 at 1:59 pm

    I think it’s a typo. You have to naviagte to http://localhost:3000/sessions/new as indicated in your routes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to using Github. I am studying Ruby on Rails with a
I have MacPorts installed Ruby on Rails which I am have been updating and
While studying C# in ASP.net I have trouble understanding several classes. In which scenario
I started studying Haskell one week ago and have one strange problem. I created
Studying JSR-299, I read section 5.1 of the Weld reference which explains how scopes
Im studying inline functions in C++ and have come to a section concerning limitations
I'm new to ruby world and i'm currently studying it. I have read over
After studying Hadley's book and searching here on SO I have created a heatmap
I am using Ruby on Rails 3 and and I am trying to implement
Hi im studying JSF 2.0 Using tomcat 6.0.26 When a start a simple page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.