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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:08:17+00:00 2026-05-27T14:08:17+00:00

I’m going through the railstutorial.org book, and after adding a micropost instance variable at

  • 0

I’m going through the railstutorial.org book, and after adding a micropost instance variable at app/controllers/pages_controller.rb, my app’s homepage fails to render and instead gives me the following error (on the browser):

ActionView::MissingTemplate in Pages#home

Showing /app/views/pages/home.html.erb where line #9 raised:

Missing partial shared/user_info with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/app/views"
Extracted source (around line #9):

6:         <%= render 'shared/micropost_form' %>
7:       </td>
8:       <td class="sidebar round">
9:         <%= render 'shared/user_info' %>
10:       </td>
11:     </tr>
12:   </table>
Rails.root: /home/panos/sites/sample_app

Application Trace | Framework Trace | Full Trace
app/views/pages/home.html.erb:9:in `_app_views_pages_home_html_erb__134372853_79989310__180950044'

Rspec gives me the following errors:

Failures:

  1) MicropostsController POST 'create' failure should not create a micropost
     Failure/Error: post :create, :micropost => @attr
     ActionView::Template::Error:
       Missing partial shared/user_info with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/home/panos/sites/sample_app/app/views"
     # ./app/views/pages/home.html.erb:9:in `_app_views_pages_home_html_erb__186087139_72921610__1052842684'
     # ./app/controllers/microposts_controller.rb:10:in `create'
     # ./spec/controllers/microposts_controller_spec.rb:33:in `block (5 levels) in <top (required)>'
     # ./spec/controllers/microposts_controller_spec.rb:32:in `block (4 levels) in <top (required)>'

  2) MicropostsController POST 'create' failure should render the home page
     Failure/Error: post :create, :micropost => @attr
     ActionView::Template::Error:
       Missing partial shared/user_info with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/home/panos/sites/sample_app/app/views"
     # ./app/views/pages/home.html.erb:9:in `_app_views_pages_home_html_erb__186087139_72921610__1052842684'
     # ./app/controllers/microposts_controller.rb:10:in `create'
     # ./spec/controllers/microposts_controller_spec.rb:38:in `block (4 levels) in <top (required)>'

  3) UsersController GET 'new' should be successful
     Failure/Error: get :new
     ActionView::Template::Error:
       undefined local variable or method `object' for #<#<Class:0xa89d8ac>:0xaa3a174>
     # ./app/views/shared/_error_messages.html.erb:1:in `_app_views_shared__error_messages_html_erb__638819034_88046780__702891636'
     # ./app/views/users/new.html.erb:4:in `block in _app_views_users_new_html_erb__995846824_89246620__1052842684'
     # ./app/views/users/new.html.erb:3:in `_app_views_users_new_html_erb__995846824_89246620__1052842684'
     # ./spec/controllers/users_controller_spec.rb:102:in `block (3 levels) in <top (required)>'

  4) UsersController GET 'new' should have the right title
     Failure/Error: get :new
     ActionView::Template::Error:
       undefined local variable or method `object' for #<#<Class:0xa89d8ac>:0xaa08ae8>
     # ./app/views/shared/_error_messages.html.erb:1:in `_app_views_shared__error_messages_html_erb__638819034_88046780__702891636'
     # ./app/views/users/new.html.erb:4:in `block in _app_views_users_new_html_erb__995846824_89246620__1052842684'
     # ./app/views/users/new.html.erb:3:in `_app_views_users_new_html_erb__995846824_89246620__1052842684'
     # ./spec/controllers/users_controller_spec.rb:107:in `block (3 levels) in <top (required)>'

  5) UsersController POST 'create' failure should not create a user
     Failure/Error: post :create, :user => @attr
     ActionView::Template::Error:
       undefined local variable or method `object' for #<#<Class:0xa89d8ac>:0xa99271c>
     # ./app/views/shared/_error_messages.html.erb:1:in `_app_views_shared__error_messages_html_erb__638819034_88046780__702891636'
     # ./app/views/users/new.html.erb:4:in `block in _app_views_users_new_html_erb__995846824_89246620__1052842684'
     # ./app/views/users/new.html.erb:3:in `_app_views_users_new_html_erb__995846824_89246620__1052842684'
     # ./app/controllers/users_controller.rb:30:in `create'
     # ./spec/controllers/users_controller_spec.rb:122:in `block (5 levels) in <top (required)>'
     # ./spec/controllers/users_controller_spec.rb:121:in `block (4 levels) in <top (required)>'

Here is my home.html.erb file:

<% if signed_in? %>
  <table class="front" summary="For signed-in users">
    <tr>
      <td class="main">
        <h1 class="micropost">What's up?</h1>
        <%= render 'shared/micropost_form' %>
      </td>
      <td class="sidebar round">
        <%= render 'shared/user_info' %>
      </td>
    </tr>
  </table>
<% else %>
  <h1>Sample App</h1>

  <p>
    This is the home page for the
    <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
    sample application.
  </p>

  <%= link_to "Sign up now!", signup_path, :class => "signup_button round" %>
<% end %>

And here is my _user_info.html.erb file:

<div class="user_info">
  <a href="<%= user_path(current_user) %>">
    <%= gravatar_for current_user, :size => 30 %>
    <span class="user_name">
      <%= current_user.name %>
    </span>
    <span class="microposts">
      <%= pluralize(current_user.microposts.count, "micropost") %>
    </span>
  </a>
</div>

I dont think I’ve made a mistake in following the tutorial. I’ve even looked through similar threads stackoverflow.com threads, to no avail:

  • NoMethodError in Pages#home

  • ruby on rails tutorial – rails 3.0 chapter 11 rspec fails after code listing 11.27

Does anyone have any ideas?

  • 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-27T14:08:17+00:00Added an answer on May 27, 2026 at 2:08 pm

    It is missing the following code at app/views/shared/_user_info.html.erb

    <div class="user_info">
        <a href="<%= user_path(current_user) %>">
        <%= gravatar_for current_user, :size => 30 %>
        <span class="user_name">
            <%= current_user.name %>
        </span>
        <span class="microposts">
            <%= pluralize(current_user.microposts.count, "micropost") %>
        </span>
        </a>
    </div>
    
    • 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
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am using Paperclip to handle profile photo uploads in my app. They upload
I am writing an app with both english and french support. The app requests
I am trying to loop through a bunch of documents I have to put
I would like to count the length of a string with PHP. The string

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.