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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:06:03+00:00 2026-06-05T08:06:03+00:00

I have the following code in my view: <%= gravatar_for @user %> and the

  • 0

I have the following code in my view:

<%= gravatar_for @user %>

and the following code in my helper:

module UsersHelper
    def gravatar_for(user)
        gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
        gravatar_url = "http://gravatar.com/avatar#{gravatar_id}.png"
        image_tag(gravatar_url, alt: user.first_name.to_s + user.last_name.to_s, class: gravatar)
    end

end

However I’m getting an error: undefined local variable or methodgravatar’ for #<#:0x00000100a1cbf0>`

What could be causing this?

  • 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-05T08:06:04+00:00Added an answer on June 5, 2026 at 8:06 am

    You’re using a reference, gravatar, in the call to image_tag.

    If you mean to apply a style, use a string, "gravatar". Otherwise you need to make sure the method or value gravatar exists/is initialized, and available.

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

Sidebar

Related Questions

I have the following code in a view: def controller_details(request, object_id): controller = Controller.objects.get(pk=object_id)
I have the following view code: def activate( request = '', actkey = ):
I have the following code in the view call.. def view(request): body = u
I have the following View code: @using (Html.BeginForm(Login, Press, FormMethod.Post)) { <fieldset> <legend>User Registration</legend>
I have the following code: [self.view bringSubviewToFront:loggingIn]; [self loginWithUsername:user Password:pw]; This is inside an
I have the following code in a view @User.Identity.Name Works fine. The same code
I have the following code inside a partial view: @if (Request.IsAuthenticated) { Hello, @Html.ActionLink(User.Identity.Name,
I have the following code on a view: @using (Html.BeginForm()) { <div class=select-box form>
I have the following code in a view to get some of the information
I have the following code in a view: <div class=wrap_select> @Html.DropDownList(dateRange, new SelectList(Model.DateRange, Value,Text),

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.