How to use inputmask in slim

Asked 1 years ago, Updated 1 years ago, 66 views

We are developing Ruby on Rails by applying AdminLTE.
The part I want to use in AdminLTE this time is the code below.

<div class="form-group">
  <label>Date masks:</label>

    <div class="input-group">
      <div class="input-group-addon">
        <i class="fa fa-calendar">/i>
      </div>
      <input type="text" class="form-control" data-inputmask="alias":'dd/mm/yyyy'" data-mask>
    </div>
    <!--/.input group-->
  </div>
  <!--/.form group-->
</div>

I would like to change the above code to slim.
Below is my code.

div.box-body
  = form_for@bookdo|f|
    div.form-group
      .field
        = f.label: publication date

= I would like you to change it to a slim code using f.text_field.
Especially

<input type="text" class="form-control" data-inputmask="alias":'dd/mm/yyyy'" data-mask>

I don't know how to write the data-inputmask="alias":'dd/mm/yyyy'" data-mask on the slim.

ruby-on-rails slim

2022-09-30 20:23

1 Answers

As for the conversion to slim, there seems to be a conversion site from html to slim.

https://html2slim.herokuapp.com/

When I used this, it was as follows.

.form-group
  label Date masks:
  .input-group
    .input-group-addon
      i.fa.fa-calendar
    input.form-control data-inputmask=('alias':'dd/mm/yyyy')data-mask=""type="text"/
  /! /.input group
/! /.form group


2022-09-30 20:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.