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 7419747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:07:30+00:00 2026-05-29T08:07:30+00:00

I’m reading Ruby on Rails tutorial. On chapter 9 after wrote all the code,

  • 0

I’m reading Ruby on Rails tutorial. On chapter 9 after wrote all the code, for sign in and remember me code. My rspec test still fail. this are the exactly error:

Failures:
  1) SessionsController POST 'create' with valid email and password should sign the user in
     Failure/Error: post :create, :session => @attr
     undefined local variable or method `summitted_password' for #<Class:0x007fc05395e280>
     # ./app/models/user.rb:38:in `authenticate'
     # ./app/controllers/sessions_controller.rb:7:in `create'
     # ./spec/controllers/sessions_controller_spec.rb:47:in `block (4 levels) in <top (required)>'

  2) SessionsController POST 'create' with valid email and password should redirect to the user show page
     Failure/Error: post :create, :session => @attr
     undefined local variable or method `summitted_password' for #<Class:0x007fc05395e280>
     # ./app/models/user.rb:38:in `authenticate'
     # ./app/controllers/sessions_controller.rb:7:in `create'
     # ./spec/controllers/sessions_controller_spec.rb:53:in `block (4 levels) in <top (required)>'

Finished in 0.90025 seconds
7 examples, 2 failures

Does anybody have the same problem, because I didn’t find any typo.

This is my session_controller

class SessionsController < ApplicationController
  def new
    @title = "Sign in"
  end

  def create
    user = User.authenticate(params[:session][:email],
                             params[:session][:password])
     if user.nil?
      flash.now[:error] = "Invalid email/password combination."
      @title = "Sign in"
      render 'new'
    else
      sign_in user
      redirect_to user
    end
  end

  def destroy
  end

end

After fixed the type on the user model, I get this error on the test:

Failures:
  1) SessionsController POST 'create' with valid email and password should sign the user in
     Failure/Error: post :create, :session => @attr
     undefined method `user_url' for #<SessionsController:0x007fc347354e38>
     # ./app/controllers/sessions_controller.rb:15:in `create'
     # ./spec/controllers/sessions_controller_spec.rb:47:in `block (4 levels) in <top (required)>'

  2) SessionsController POST 'create' with valid email and password should redirect to the user show page
     Failure/Error: post :create, :session => @attr
     undefined method `user_url' for #<SessionsController:0x007fc34679aa20>
     # ./app/controllers/sessions_controller.rb:15:in `create'
     # ./spec/controllers/sessions_controller_spec.rb:53:in `block (4 levels) in <top (required)>'

Finished in 0.58335 seconds

This is my bundle exec rake routes

WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /Users/jeanosorio/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method SampleApp::Application#task called at /Users/jeanosorio/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.0.0/lib/rails/application.rb:214:in `initialize_tasks'
       users POST   /users(.:format)        {:action=>"create", :controller=>"users"}
   new_users GET    /users/new(.:format)    {:action=>"new", :controller=>"users"}
  edit_users GET    /users/edit(.:format)   {:action=>"edit", :controller=>"users"}
       users GET    /users(.:format)        {:action=>"show", :controller=>"users"}
       users PUT    /users(.:format)        {:action=>"update", :controller=>"users"}
       users DELETE /users(.:format)        {:action=>"destroy", :controller=>"users"}
    sessions POST   /sessions(.:format)     {:action=>"create", :controller=>"sessions"}
new_sessions GET    /sessions/new(.:format) {:action=>"new", :controller=>"sessions"}
    sessions DELETE /sessions(.:format)     {:action=>"destroy", :controller=>"sessions"}
      signup        /signup(.:format)       {:controller=>"users", :action=>"new"}
      signin        /signin(.:format)       {:controller=>"sessions", :action=>"new"}
     signout        /signout(.:format)      {:controller=>"sessions", :action=>"destroy"}
     contact        /contact(.:format)      {:controller=>"pages", :action=>"contact"}
       about        /about(.:format)        {:controller=>"pages", :action=>"about"}
        help        /help(.:format)         {:controller=>"pages", :action=>"help"}
        root        /(.:format)             {:controller=>"pages", :action=>"home"}

routes.rb file

SampleApp::Application.routes.draw do
  resource :users
  resource :sessions, :only => [:new, :create, :destroy]

  match '/signup',  :to => 'users#new'
  match '/signin',  :to => 'sessions#new'
  match '/signout', :to => 'sessions#destroy'
  match '/contact', :to => 'pages#contact'

  match '/about',   :to => 'pages#about'

  match '/help',    :to => 'pages#help'

  root :to => 'pages#home'
end

Thanks

  • 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-05-29T08:07:32+00:00Added an answer on May 29, 2026 at 8:07 am

    You are a letter out.

    it should be submitted_password not summitted_password on line 38 of user.rb

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.