How to create a form to select a date from the calendar

Ordinary input form (before change)

View file


<%= form.text_area :day, placeholder: "day" %>

前.png

Calendar selection form (after change)

** Change from text_area to datetime_field. ** **

View file


<%= form.datetime_field :day, placeholder: "day" %>

後.png

Summary

You may think that it is difficult to describe before the change, but In fact, you can do it just by changing the description a little! !! Please try it.

that's all.

Recommended Posts

How to create a form to select a date from the calendar
I want to create a form to select the [Rails] category
How to create a method
3. Create a database to access from the web module
How to create a route directly from the URL you want to specify + α
How to write a migration from Rails datetime type to date type
How to create a placeholder part to use in the IN clause
[Java] How to create a folder
How to select a specified date by code in FSCalendar
[Rails 6] How to create a dynamic form input screen using cocoon
How to run a Kotlin Coroutine sample from the command line
Create a calendar from the Calendar class by specifying the year and month
How to make a Java calendar Summary
How to create a Maven repository for 2020
[Java] How to set the Date time to 00:00:00
How to get the date in java
[Swift5] How to create a splash screen
[rails] How to create a partial template
[Java] How to use the Calendar class
How to return a value from Model to Controller using the [Swift5] protocol
How to run a GIF file from the Linux command line (Ubuntu)
How to get the current date as a string in yyyyMMdd format
[Rails] How to create a table, add a column, and change the column type
How to create a database for H2 Database anywhere
[Rails] How to create a graph using lazy_high_charts
How to get a heapdump from a Docker container
How to create pagination for a "kaminari" array
How to create a class that inherits class information
How to create a theme in Liferay 7 / DXP
[1st] How to create a Spring-MVC framework project
How to easily create a pull-down in Rails
[Rails] How to create a Twitter share button
How to display the result of form input
[Java] How to use Calendar class and Date class
Shows how many years and months the difference from a particular date is
[Spring sample code included] How to create a form and how to get multiple records
How to create an Excel form using a template file with Spring MVC
How to get the date from the JavaScript Date type that C # developers are addicted to
How to create docker-compose
How to create a Java environment in just 3 seconds
How to run the SpringBoot app as a service
[Rails] How to create a signed URL for CloudFront
[Java] I want to calculate the difference from the date
How to jump from Eclipse Java to a SQL file
How to write Scala from the perspective of Java
How to deploy to Heroku from a local docker image
I tried to decorate the simple calendar a little
[Java] How to extract the file name from the path
Reasons to include ActiveModel :: Model to create a Form object
How to create a Spring Boot project in IntelliJ
[Spring Boot] How to create a project (for beginners)
How to create a data URI (base64) in Java
How to write a date comparison search in Rails
[Java] How to erase a specific character from a character string
How to determine the look-ahead request (Prefetch) from the browser
How to make a mod for Slay the Spire
[Apple Subscription Offer] How to create a promotional offer signature
A memo about the types of Java O/R mappers and how to select them
How to create an application
How to transition from the [Swift5] app to the iPhone settings screen
How to display the select field of time_select every 30 minutes