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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:44:53+00:00 2026-06-18T10:44:53+00:00

I am using Rails on a web application. I would like to know if

  • 0

I am using Rails on a web application.
I would like to know if its possible to tell datetime_select to only have two options in the minutes drop down list? Options 00 and 30.

I have the below code:

<p><label for="command_date_to_execute">Date to Run</label><br/>
<%= datetime_select 'command', 'date_to_run', :discard_minute => true  %>:
<%= select 'command', 'date_to_run', ['00', '30'] %>
</p>

The browser source produces:

<select id="command_date_to_run" name="command[date_to_run]">
<option value="00">00</option>
<option value="30">30</option>
</select>

But I really need is below (with the 5i in the generated HTML):


    

<select id="command_date_to_execute_5i" name="command[date_to_execute(5i)]">
<option value="00">00</option>
<option value="30">30</option>
</select>

Please help

  • 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-18T10:44:54+00:00Added an answer on June 18, 2026 at 10:44 am

    If you only want values 00 and 30 to be displayed for the minutes, you can do the below:

    = f.datetime_select(:leave_end, :start_year => 2011, :ampm => true, :default => 0.days.from_now.in_time_zone(@timezone), :discard_minute => true) %span : 
    = f.select('req_sess_start(5i)', ['00', '30'])
    

    This might get exceptions on the page validation due to the (possibly) unknown variable req_sess_start(5i). Will work if validation is met.

    The below would work better though as will not throw the exception.

    = f.datetime_select(:req_sess_start, :start_year => 2011, :ampm => true, :default => 0.days.from_now.in_time_zone(@timezone), :minute_step => 30)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ruby on Rails to develop a web application. I have a wiki
I have recently designed a web application that I would like to write in
I am using Ruby on Rails 3 and I would like to know how
I am using Ruby on Rails 3.2.2 and I would like to know how
I am using Ruby on Rails v3.0.9 and I have a web application running
I have recently been using rails for a web application, and so I have
I would like to make my application somewhat REST compliant. I am using Rails
I am using Ruby on Rails 3.1 and I would like to know (for
I am building web applications using Ruby on Rails and I would like to
Hey so I am using Rails PJAX for my web application with twitter bootstrap

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.