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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:21:42+00:00 2026-06-04T15:21:42+00:00

Getting the following error when implementing this calendar gem. NoMethodError in Users#show Showing /Users/nelsonkeating/Desktop/ReminDeal/app/views/users/show.html.erb

  • 0

Getting the following error when implementing this calendar gem.

NoMethodError in Users#show

Showing /Users/nelsonkeating/Desktop/ReminDeal/app/views/users/show.html.erb where line #66 raised:

undefined method `strftime' for nil:NilClass
Extracted source (around line #66):

63:   </h2>
64:                 <%= calendar_for @friends, :year => @date.year, :month => @date.month do |calendar| %>
65:                  <%= calendar.head('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun') %>
66:                   <%= calendar.day(:day_method => :dob) do |date, friends| %>
67:                    <%= date.day %>
68:                     <ul>
69:                         <% friends.each do |friend| %>

users_controller.rb

   class UsersController < ApplicationController
   before_filter :authenticate_user!

  def index
    authorize! :index, @user, :message => 'Not authorized as an administrator.'
    @users = User.paginate(:page => params[:page])

  end

  def show
    @user = User.find(params[:id])
    @friends = @user.friends.paginate(page: params[:page])
    @date = params[:month] ? Date.parse(params[:month]) : Date.today
   end

users/show.html.erb

<div id="calendar">
    <h2 id="month">
    <%= link_to "<", :month => (@date.beginning_of_month-1).strftime("%Y-%m") %>
    <%=h @date.strftime("%B %Y") %>
    <%= link_to ">", :month => (@date.end_of_month+1).strftime("%Y-%m") %>
  </h2>
                <%= calendar_for @friends, :year => @date.year, :month => @date.month do |calendar| %>
                 <%= calendar.head('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun') %>
                  <%= calendar.day(:day_method => :dob) do |date, friends| %>
                   <%= date.day %>
                    <ul>
                        <% friends.each do |friend| %>
                        <li> <%= link_to h(friend.name), friends %></li>
                     <% end %>
                    </ul>
                <% end %>
            <% end %>
</div>

friend.rb

# == Schema Information
#
# Table name: friends
#
#  id         :integer         not null, primary key
#  name       :string(255)
#  dob        :date
#  gender     :string(255)
#  user_id    :integer
#  created_at :datetime        not null
#  updated_at :datetime        not null
#  int        :string(255)
#

class Friend < ActiveRecord::Base
  attr_accessible :name, :dob, :gender, :interests, :int, :interest_ids, :date
  belongs_to :user
  has_many :person_interests, :as => :person
  has_many :interests, :through => :person_interests
  serialize :ints

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-06-04T15:21:43+00:00Added an answer on June 4, 2026 at 3:21 pm

    You don’t have @date defined in your show action.

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

Sidebar

Related Questions

We are getting following error when we try to validate our app. This bundle
I have done simple java app for blackberry, while building am getting following error.
Am getting following error message on calling WCF service: The formatter threw an exception
I am getting following error when I am trying to get WebResponse using WebResponse
I am getting following error message when using Doctrine ORM in Codeigniter. ( !
I am getting following error in different places like when I am removing an
I am getting following error: error: calling a host function(strcpy) from a __device__/__global__ function(doDecompression)
SOLVED in the last answer im getting following error, dunno where and why? cause
New to android programming. Getting Following error. 04-07 14:49:05.452: ERROR/AndroidRuntime(1566): FATAL EXCEPTION: main java.lang.OutOfMemoryError
Am trying to insert XML into XML Column.. getting following error: . Msg 6819,

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.