[RUBY] How to display the select field of time_select every 30 minutes


I'm creating an app with Rails and want to use time_select to enter the time, but it was difficult to use in 1 minute increments by default, so I made it in 30 minute increments.


First of all, the current situation

= f.time_select :end, {}, class: 'content__main__box__field__select'

In this case, in addition to the display every minute, the current time is automatically entered in the select column.

= f.time_select :end, {:include_blank => true, :minute_step => 30}, class:'content__main__box__field__select'

Now you can only select 00 minutes and 30 minutes, and the current time is not automatically entered in the select column, it is completely blank.

I learned the importance of ** Guguru Power ** again! Lol Even if I searched, it didn't hit well and it took a long time ...

I study every day.

Recommended Posts

How to display the select field of time_select every 30 minutes
How to display the result of form input
How to delete / update the list field of OneToMany
[Rails] How to display the list of posts by category
How to display 0 on the left side of the standard input value
[Rails] How to omit the display of the character string of the link_to method
How to determine the number of parallels
How to sort the List of SelectItem
How to switch the display of the header menu for each transition page
Summary of how to select elements in Selenium
How to find the cause of the Ruby error
Customize how to divide the contents of Recyclerview
How to get today's day of the week
Output of how to use the slice method
[Ruby] Code to display the day of the week
[Java] How to get the authority of the folder
How to display the amount of disk used by Docker container for each container
[Java] How to get the URL of the transition source
How to write Scala from the perspective of Java
[Rails, JS] How to implement asynchronous display of comments
[Ruby] How to find the sum of each digit
Understand the characteristics of Scala in 5 minutes (Introduction to Scala)
How to install the root certificate of Centos7 (Cybertrust)
[Java] How to get the maximum value of HashMap
I want to display the name of the poster of the comment
[Rails] How to change the column name of the table
[SwiftUI] How to specify the abbreviated position of Text
[Android] How to get the setting language of the terminal
[Rails] How to get the contents of strong parameters
How to judge the click of any area of the image
How to download the old version of Apache Tomcat
[Swift] How to get the document ID of Firebase
[Rails] How to display an image in the view
A memo about the types of Java O/R mappers and how to select them
[Java] How to display the day of the week acquired by LocalDate, DateTimeformatter in Japanese
[Rails] How to display the weather forecast of the registered address in Japanese using OpenWeatherMap
How to create a form to select a date from the calendar
Android app to select and display images from the gallery
[Java] How to display Wingdings
How to get the longest information from Twitter as of 12/12/2016
How to change the setting value of Springboot Hikari CP
[Ruby] How to retrieve the contents of a double hash
How to add elements without specifying the length of the array
Let's summarize how to extend the expiration date of Rails
How to solve the problems of Java's three Blocking Queues
How to mock some methods of the class under test
How to implement one-line display of TextView in Android development
How to derive the last day of the month in Java
How to change the contents of the jar file without decompressing
How to disable existing selected items in the select box
How to check the extension and size of uploaded files
How to make th: value of select have multiple values
I want to narrow down the display of docker ps
[jsoup] How to get the full amount of a document
[Rails] How to display information stored in the database in view
How to check the database of apps deployed on Heroku
[Swift] How to dynamically change the height of the toolbar on the keyboard
[Rails] How to get the URL of the transition source and redirect
[Swift] How to display when the quiz app answers correctly [Beginner]
[Swift5] How to get an array and the complement of arrays
How to set the IP address and host name of CentOS8