[How to use label]

We will output a method for implementing the function of displaying an icon in the view and clicking the icon to display the file selection screen. This time we will use haml notation.

icon_label.png

Specify the label.class name as the parent element as shown in the image above, Nest the icon you want to display to the parent element.

This time this icon I want to add a function that the file selection screen appears when you click on Write input. class name {type: "file"} under icon.

This input {type: "file"} is the description part of the function that the file selection screen appears.

In this way, the file selection screen can be displayed when the icon is clicked in the flow of nesting for label → describing the icon to be displayed → describing the function to be implemented for the icon.

label.png

Click the icon to the left of the Send button to see the following.

label1.png

The file selection screen is appearing.

As an additional note, input {type: "file"} is a description for making the file selection screen appear, but as it is, it is as follows.

label4.png

Since the message "Select file" appears, you need to write the following in css to turn off this display.

label5.png

.Hidden is the class name for input {type: "file"}. You can hide the selection of files by setting display: none ;.

that's all.

Recommended Posts

[How to use label]
How to use Map
How to use rbenv
How to use with_option
How to use fields_for
How to use java.util.logging
How to use map
How to use collection_select
How to use Twitter4J
How to use active_hash! !!
How to use MapStruct
How to use identity
How to use hashes
How to use Dozer.mapper
How to use Gradle
How to use org.immutables
How to use java.util.stream.Collector
How to use VisualVM
How to use Map
How to use Chain API
[Java] How to use Map
How to use Priority Queuing
[Rails] How to use enum
How to use java Optional
How to use JUnit (beginner)
How to use Ruby return
[Rails] How to use enum
How to use @Builder (Lombok)
How to use java class
How to use Big Decimal
[Java] How to use removeAll ()
How to use String [] args
How to use rails join
How to use Java Map
Ruby: How to use cookies
How to use dependent :: destroy
How to use Eclipse Debug_Shell
How to use Apache POI
[Rails] How to use validation
How to use Java variables
[Rails] How to use authenticate_user!
How to use GC Viewer
How to use Lombok now
[Creating] How to use JUnit
[Rails] How to use Scope
How to use the link_to method
[Rails] How to use gem "devise"
How to use Lombok in Spring
How to use StringBurrer and Arrays.toString.
How to use arrays (personal memorandum)
How to use Java HttpClient (Get)
How to use scope (JSP & Servlet)
How to use the include? method
[Rails] How to use devise (Note)
How to use the form_with method
[Rails] How to use flash messages
How to use EventBus3 and ThreadMode
How to use Spring Data JDBC
How to use binding.pry [53 days left]
How to use Java HttpClient (Post)
[Java] How to use join method