Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue with adding html5 data attributes to div tag #9

Closed
madhermit opened this Issue · 2 comments

2 participants

@madhermit

I'm running into an issue when trying to add a data attribute to a div tag like so:
div id: 'some-id', data: { foo: 'bar' }
this outputs the following:
<div class="some-id" data="{:foo=>"bar"}"></div>

Other formatting attempts such as data-foo => "bar" are met with syntax errors.

Any thoughts?

@gregbell
Owner

Arbre does not currently support building sub-hashes like content_for in Rails. However, you can get around it by using strings as the keys (since Ruby doesn't allow "-" in symbols):

div :id => "some-id", "data-foo" => "bar"
@gregbell gregbell closed this
@madhermit

Thanks! Appreciate the response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.