junjizhi / junji-blog

My own blog
MIT License
0 stars 0 forks source link

TIL: elixir keyword arguments can be string #3

Open junjizhi opened 4 years ago

junjizhi commented 4 years ago

You can do

iex(2)> a = [placeholder: 'First name', "aria-label": "First Name"]
[placeholder: 'First name', "aria-label": "First Name"]

For text_input in the view (*.slim files), you can do:

= text_input @contact, :first_name, placeholder: 'First name', "aria-label": "First Name"

For accessibility, we need aria-label.