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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:51:47+00:00 2026-05-26T06:51:47+00:00

I’m running through the Ruby on Rails Tutorial 3, and having a ball doing

  • 0

I’m running through the Ruby on Rails Tutorial 3, and having a ball doing it, but I’ve just come across some problems that aren’t getting solved. When I run my specs, two tests fail.

Failures:
  1) UsersController PUT 'update' failure should render the 'edit' page
  Failure/Error: put :update, :id => @user, :user => @attr
  undefined local variable or method `object' for #<#<Class:0x00000102c861c8>:0x00000101d25558>
 # ./app/views/shared/_error_messages.html.erb:3:in `_app_views_shared__error_messages_html_erb___3390867530789228804_2170854120__2806434579894406668'
 # ./app/views/users/edit.html.erb:4:in `block in _app_views_users_edit_html_erb__558009768664311469_2170714160__919273585470661416'
 # ./app/views/users/edit.html.erb:3:in `_app_views_users_edit_html_erb__558009768664311469_2170714160__919273585470661416'
 # ./app/controllers/users_controller.rb:47:in `update'
 # ./spec/controllers/users_controller_spec.rb:158:in `block (4 levels) in <top (required)>'

2) UsersController PUT 'update' failure should have the right title
 Failure/Error: put :update, :id => @user, :user => @attr
 undefined local variable or method `object' for #<#<Class:0x00000102c861c8>:0x00000101b211f8>
 # ./app/views/shared/_error_messages.html.erb:3:in `_app_views_shared__error_messages_html_erb___3390867530789228804_2170854120__2806434579894406668'
 # ./app/views/users/edit.html.erb:4:in `block in _app_views_users_edit_html_erb__558009768664311469_2170714160__919273585470661416'
 # ./app/views/users/edit.html.erb:3:in `_app_views_users_edit_html_erb__558009768664311469_2170714160__919273585470661416'
 # ./app/controllers/users_controller.rb:47:in `update'
 # ./spec/controllers/users_controller_spec.rb:163:in `block (4 levels) in <top (required)>'

I’ve searched through my code as best I can comparing it against the code in the book, and I’ve come up with nothing. I’m sure it’s one stupid little thing that I’ve missed, and I would greatly appreciate a second pair (or more 😉 of eyes.

Here are my tests:

describe "failure" do
  before(:each) do
    @attr = { :email => "", :name => "", :password => "", :password_confirmation => "" }
  end

  it "should render the 'edit' page" do
    put :update, :id => @user, :user => @attr
    response.should render_template('edit')
  end

  it "should have the right title" do
    put :update, :id => @user, :user => @attr
    response.should have_selector("title", :content => "Edit User")
  end
end

And here is the update methods from the users_controller:

def update
@user = User.find(params[:id])
if @user.update_attributes(params[:user])
  flash[:success] = "Profile updated"
  redirect_to @user
else
  @title = "Edit User"
  render 'edit'
end
end

Any thoughts on where I should look are greatly appreciated.

  • 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-26T06:51:47+00:00Added an answer on May 26, 2026 at 6:51 am

    The source of the problem is not in spec files even though the problem manifests itself in those spec files. The instructor, Michael Hartl, changes the following statement:

    <%= render 'shared/error_messages' %
                      to 
    <%= render 'shared/error_messages', :object => f.object %>
    

    statement. In other words, he adds “, :object => f.object” to the first statement. And you must look in all files that have the original statement and change them to the second one. If you miss any of them you will have these errors. Specifically look in the following files (and any other that may have the original statement):

    app/views/users/edit.html.erb
    app/views/users/fields.html.erb
    app/views/users/new.html.erb
    app/views/shared/micropost_form.html.erb
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to loop through a bunch of documents I have to put
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.