Greetings,
I just pushed POC stimulus_tag_helper gem that I wrote for myself and using it for a while. If anyone is interested to try it and give feedback you are welcome!
https://github.com/crawler/stimulus_tag_helper
Greetings,
I just pushed POC stimulus_tag_helper gem that I wrote for myself and using it for a while. If anyone is interested to try it and give feedback you are welcome!
https://github.com/crawler/stimulus_tag_helper
Hey! This look like a cool wrapper for Stimulus controllers. Why the use of the double splat when assigning the data attributes?
Sorry for the late response. I did not receive a notification about your message.
In the example sc.target("name")
will return { data: { "hello-target" => "name"} }
, so if you want to add more attributes to your tag, then you have two options:
text_field_tag("", "", sc.target("name").merge(class: "input-field"))
text_field_tag("", "", **sc.target("name"), class: "input-field")
I think I need to add more examples showing the flexibility of this lib
Thank you for the interest!