judofyr / tubby

HTML templates as Ruby
Other
49 stars 3 forks source link

Explode data: attribute #3

Closed zverok closed 3 years ago

zverok commented 3 years ago

Thanks for the amazing library! We are using it in production a lot, and I really love how small and focused and no-magic it is. So here I am with a feature proposal :joy:

What I am missing in the current functionality is "data"-attributes: It is frequently necessary to put some data in a "widget", and the usual agreement in a lot of templating languages, that data: {foo: 1, bar: 2} attrs are rendered as data-foo='1' data-bar='2' in HTML.

So, I propose to add it. The change seems to be small enough (but I understand if you are feeling uneasy about expanding the functionality).

judofyr commented 3 years ago

Thanks for the amazing library! We are using it in production a lot, and I really love how small and focused and no-magic it is.

Wow, that's very nice to hear!

What I am missing in the current functionality is "data"-attributes: It is frequently necessary to put some data in a "widget", and the usual agreement in a lot of templating languages, that data: {foo: 1, bar: 2} attrs are rendered as data-foo='1' data-bar='2' in HTML.

So, I propose to add it. The change seems to be small enough (but I understand if you are feeling uneasy about expanding the functionality).

I think it's a sensible feature request, and I don't think that it will bloat it too much.

zverok commented 3 years ago

Any plans on publishing it as a new gem version? :cat:

judofyr commented 3 years ago

Done!