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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:10:31+00:00 2026-06-14T15:10:31+00:00

I am trying to list dates of the month vertically, so far my table

  • 0

I am trying to list dates of the month vertically, so far my table looks as followed:

enter image description here

I have today’s date however I need to list 18 days from today vertically. As well as generate the cells against these dates. From my index.html.erb I understand that I have the following @dates variable isn’t being set properly in my controller.

@dates variable isn’t being set properly, if you add the statement
<%= debug @dates %> to your view you can inspect what it’s being

Controller: Gist – Controller.rb

Index: Gist – Index.html.erb

Model: Gist – Model.rb

I understand that I will need to change my controller’s index action so it is able to list 18 days from today. I was thinking of doing something somewhat similar.. – Time.now+18.days However I am not sure if something like this would solve my problems? As I’m not fully sure how to implement this into my controller. What is the best possible solution?

  • 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-14T15:10:32+00:00Added an answer on June 14, 2026 at 3:10 pm
    t1 = Date.today
    t2 = Date.today.end_of_month
    @dates = (t1..t2).to_a 
    # (t1..t2) is a Range object - .to_a call will change it to an array object with values in the range as elements
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table users with a column date_of_birth (DATE format with day, month,
I am trying to have a table view list a number of objects that
I am trying to create a list of birth days, ordered by the dates,
I'm trying to have 3 combo boxes for users to enter dates. The Month
I'm trying to group a list of date/times in Jinja by month/year. Here's the
I'm trying to list a few date ranges based off the last Tuesday which
I am trying to create a select list starting from the current date of
I am trying to list the people who have birthday this week with this
I'm just trying to list my blog posts for a certain month in a
FY runs Oct-Sep, I have a list with a date field, and I am

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.