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

  • Home
  • SEARCH
  • 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 7057641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:00:40+00:00 2026-05-28T04:00:40+00:00

Everytime I try and access the user profile page, I get this error. ActionView::Template::Error

  • 0

Everytime I try and access the user profile page, I get this error.

ActionView::Template::Error (undefined method `email' for nil:NilClass):
2:   <tr>
3:     <td class="main">
4:       <h1>
5:         <%= gravatar_for @user %>
6:         <%= @user.name %>
7:       </h1>
8:     </td>

app/helpers/users_helper.rb:4:in `gravatar_for'
app/views/users/show.html.erb:5:in `_app_views_users_show_html_erb__222181804_33777120'

Below is what my users.controller.rb file looks like.

def show
@user = User.find(params[:id])
@microposts = @user.microposts.paginate(:page => params[:page])
@title = @user.name

For additional reference, below is a copy of my show.html.erb file.

<table class="profile" summary="Profile information">
  <tr>
    <td class="main">
      <h1>
        <%= gravatar_for @user %>
        <%= @user.name %>
      </h1>
    </td>
    <td class="sidebar round">
      <strong>Name</strong> <%= @user.name %><br />
      <strong>URL</strong>  <%= link_to user_path(@user), @user %>
    </td>
  </tr>
</table>

Also provided is my users_helper.rb file.

module UsersHelper

  def gravatar_for(user, options = { :size => 50 })
    gravatar_image_tag(user.email.downcase, :alt => h(user.name),
                                            :class => 'gravatar',
                                            :gravatar => options)
  end
end
  • 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-28T04:00:41+00:00Added an answer on May 28, 2026 at 4:00 am

    The error is in your helper method. Please verify that the @user object is not nil.
    Then in your view change the line number 5 like this:

    <%= gravatar_for(@user) %>
    

    define your users_helper#gravatar_for method like this

    def gravatar_for(@user)
      ..........
      @user.email
      ..........
      rerurn somthing #if you want
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error everytime I try to access phpmyadmin. http://i49.tinypic.com/ot1478.jpg I cant access
Today, everytime I try to open any .Net application I get: CLR error: 80004005
I have an asp page that loads a response user=exists everytime I try to
Im getting 500 internal server error everytime I try access my admin or login
I get an UnauthorizedAccessException everytime I try to access (just read ) a file
I get this erorr eerytime I try to create a user from the console.
every time I try to connect to database, I get this message database select
I'm building an Access database and I'm getting a User-defined type not defined error
Everytime I quit the app in the simulator. The console display this error message:
Everytime I try to create the following table in MySQL command line: CREATE TABLE

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.