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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:41:58+00:00 2026-06-18T23:41:58+00:00

I am completing Michael Hartl’s Rails Tutorial Chapter 10.2.2 Sample Microposts visit http://ruby.railstutorial.org/chapters/user-microposts?version=3.2#sec-creating_microposts I

  • 0

I am completing Michael Hartl’s Rails Tutorial Chapter 10.2.2 Sample Microposts

visit http://ruby.railstutorial.org/chapters/user-microposts?version=3.2#sec-creating_microposts

I am running into an issue where the profile page css will not render properly. Rspec passes, the page loads, and I can navigate the entire site without issue. The css code is called out by class which links the css code to the rails output. I will paste as much info as I can think of.
Note: I am an absolute beginner to Rails programming or object oriented anything so please be specific in your responses as I may not yet have the experience to comprehend the subject.

I would post pictures but I do not posses the required reputation points yet.

Here is some code though…

This is the HTML for the profile page that does not render properly

<% provide(:title, @user.name) %>
<div class="row">
  <aside class="span4">
    <section>
      <h1>
        <%= gravatar_for @user %>
        <%= @user.name %>
      </h1>
    </section>
  </aside>

  <div class="span8">
    <% if @user.microposts.any? %>
      <h3>Microposts (<%= @user.microposts.count %>)</h3>
      <ol class="microposts">
        <%= render @microposts %>
      </ol>
      <%= will_paginate @microposts %>
    <% end %>
  </div>

</div>

This is the css code for this page

/* microposts */

  .microposts {
    list-style: none;
    margin: 10px 0 0 0;

    li {
      padding: 10px 0;
      border-top: 1px solid #e8e8e8;
    }
  }
  .content {
    display: block;
  }

  .timestamp {
    color: $grayLight;
  }

  .gravatar {
    float: left;
    margin-right: 10px;
  }

  aside {
    textarea {
      height: 100px;
      margin-bottom: 5px;
    }
  }

Also, the home page calls upon this css code as well to render the microposts if the user is signed in. This page is also not rendering the microposts properly. The home page HTML is below

<% if signed_in? %>
  <div class="row">
    <aside class="span4">
      <section>
        <%= render 'shared/user_info' %>
      </section>
      <section>
        <%= render 'shared/micropost_form' %>
      </section>
    </aside>
     <div class="span8">
      <h3>Micropost Feed</h3>
      <%= render 'shared/feed' %>
    </div>
  </div>  
<% else %>

  <div class="center hero-unit">

    <h1>Welcome to the Sample App</h1>

        <h2>
            This is the home page for the
            <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
            sample application <br>Sample App Tutorial Completed by Jake Danforth.
        </h2>

        <%= link_to "Sign up now... Because it's Awesome!!!", signup_path, class: "btn btn-large btn-primary" %>
    </div>

    <%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>
<% end %> 

The last code calls upon the _user_info.html.erb file which the code is included below

<a href="<%= user_path(current_user) %>">
  <%= gravatar_for current_user, size: 52 %>
</a>
<h1>
  <%= current_user.name %>
</h1>
<span>
  <%= link_to "view my profile", current_user %>
</span>
<span>
  <%= pluralize(current_user.microposts.count, "micropost") %>
</span>

As I continually troubleshoot this issue, I will update what I can find out. The issue is with <%= render @microposts %> which calls the @microposts variable (right?). This is defined in file users_controller.rb as

    def show
    '@user = User.find(params[:id])
    '@microposts = @user.microposts.paginate(page: params[:page])
  end

Which does not lead to the css file as far as I can tell. Somehow this needs to call on the .microposts class in the css file to render.

  • 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-18T23:42:00+00:00Added an answer on June 18, 2026 at 11:42 pm

    I have discovered an error in the CSS code. I rearranged the CSS code to clean it up even more and found an extra bracket. I don’t know why the code was still rendering the pages without faulting, however, when I removed the bracket it began to render the screen as intended. I am leaving this file on-line in case someone else is trying the tutorial and runs into issues with brackets. Make sure that the open and close brackets are equal!

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

Sidebar

Related Questions

I'm new to rails, and after completing Michael Hartl's Ruby on Rails Tutorial, I
enter code hereI'm trying to finish up Michael Hartl's Ruby on Rails v3.2 Tutorial
I've encountered an unexpected error while following Michael Hartl's Rails Tutorial . It had
I am completing a tutorial which can be found here...http://www.elated.com/articles/cms-in-an-afternoon-php-mysql/ I am having problems
I'm completing a tutorial on Rails - however the tutorial was written with Rails
After a couple of weeks playing with rails app and completing the rails tutorial,
I am following through this tutorial and after completing it I am getting an
I have completed chapter 6 Task A: Product Maintenance but after completing the chapter
After completing the tutorial from the codeigniter user guide I ran into a problem
[SOLVED] After successfully completing the django tutorial , I have tried to use mongoDB

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.