Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attributes to elements #51

Closed
deiga opened this issue Sep 2, 2014 · 1 comment
Closed

Add attributes to elements #51

deiga opened this issue Sep 2, 2014 · 1 comment

Comments

@deiga
Copy link

deiga commented Sep 2, 2014

It would be great to add attributes to elements without having to generate a class for the element

@mvz
Copy link
Owner

mvz commented Aug 29, 2018

You can do this using the :attributes option, like so:

has_many :link, String, attributes: { 'data-src': String, type: String, href: String }

See also https://github.com/mvz/happymapper#attributes-on-empty-child-elements.

@mvz mvz closed this as completed Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants