1
votes

I have not worked yet with the Deface gem and have read Spree tutorial on Deface and skipped through the Spree/Deface explanation on Github.I cannot get the following issue working though:

In my Spree stable-2-1 with Rails 4 I have this element <li id="locale-select" data-hook="" style="float: right; margin-right: 10px;"> which is generated by the I18N gem and is available in the _main_nav_bar.html.erb on every page.

I want to add to this <li> element a class="dropdown-menu" element. The data-hook is empty. I have no idea how to accomplish this with Deface and am wondering if it is even possible.

I hope someone here can provide me more information on Deface and explain how to accomplish this task. (Maybe I am following the wrong path and should just find the element in the I18N and override it.)

1

1 Answers

1
votes

Faced with the same problem, I read through https://github.com/spree/deface, and it appears once you select the proper element, you may use the :add_to_attributes action to insert HTML attributes.