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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:32:42+00:00 2026-06-13T03:32:42+00:00

I am trying to add a calendar to my rails app using table_builder .

  • 0

I am trying to add a calendar to my rails app using table_builder. I based my implementation off of their readme and this highly recommended tutorial.

On the initial load, the calendar works beautifully. Each assignment is shown on the correct day. However, when the month is changed by clicking “>” or “<” which surround the month name, while the name of the month in the header is changed, the calendar itself is unchanged. Here is the block of code from my view that renders the calendar:

  <div id="calendar">  
  <h2 id="month">  
    <%= link_to "<", :month => (@date.beginning_of_month-1).strftime("%Y-%m-01") %>  
    <%= h @date.strftime("%B %Y") %>  
    <%= link_to ">", :month => (@date.end_of_month+1).strftime("%Y-%m-01") %>  
  </h2>   
    <%= calendar_for(@assignments) do |calendar| %>
        <%= calendar.head('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday') %>
        <% calendar.day(:day_method => :due_date) do |day, assignments| %>
            <%= day.day %>
            <ul>
                <% for assignment in assignments %>
                    <li>
                        <%= assignment.course.name %>: <%= link_to assignment.name, assignment_type_assignment_path(assignment.assignment_type, assignment)%>
                    </li>
                <% end %>
            </ul>
        <% end %>
    <% end %>
</div>  

@assignments returns a complete list of all assignments associated with a given user. Each assignment as an attribute due_date which is the date we want the assignment to appear under in the calendar.

Here is the controller code:

class HomeController < ApplicationController
    def index
        @user = @current_user
        @assignments = @user.assignments
        @date = params[:month] ? Date.parse(params[:month]) : Date.today
    end
end

Thanks

  • 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-13T03:32:43+00:00Added an answer on June 13, 2026 at 3:32 am

    You aren’t passing the current @date to the calendar_for helper, so it’s simply defaulting to rendering the current (or some default) month. You’ll need to pass in @date like this:

    calendar_for(@assignments, :year => @date.year, :month => @date.month) do |calendar|
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to add a blank sample app for a rails tutorial to GitHub, but
I am trying to add an Add to Calendar link to my web app.
I am trying to add the Calendar effect (using Primeface) to my JSF web
I am trying to add calendar event using the below code in my android
I'm trying to add an event to a Google Calendar using the Google API
I am trying to add calendar events with my Android applicatiom. Event gets saved
I am trying to add a Jquery calendar picker to a text box at
I'm trying to add a google calendar gadget along with an event. However, whenever
I am trying to manipulate SharePoint's default calendar to add, edit and delete items
When I'm trying to delete an external event from my calendar, if I add

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.