0

I am trying to use Deface gem for customizing a view that is located in gem (it is not spree). The path to the view is:

 my_gem/backend/layout/sidebar

When I run:

rake deface:test_selector['my_gem/backend/layout/sidebar','.mainnav ul']

I get two matches, the view and proper matching elements are correctly displayed. However when I run:

rake deface:get_result['my_gem/backend/layout/sidebar'] 

nothing is changed in the view and apart from its code,"Overrides(0) found" is displayed.

My Override is located in: /app/overrides/add_slider_to_sidebar.rb file:

Deface::Override.new(:virtual_path => 'my_gem/backend/layout/sidebar',
  :name => 'add_slider_to_sidebar',
  :insert_bottom => ".mainnav ul",
  gem:text => "<li>AAAAA</li>")

What should I change (or add to configuration) to allow deface to find my override?

I am using rails 4.0.5, deface 1.0.0 and nokogiri 1.6.2.1.

Edit:

I've made following tests:

  1. Add deface to the application, and do the change mentioned above. Everything worked fine.
  2. Add deface to the gem - so test in dummy application. The behavior described above has occurred.
  3. Add gem with deface view modifications from point 2 but to regular application, not the dummy one. The above behavior has occurred.
4

0 回答 0