Questions tagged [deface]

Deface is a library that allows you to customize HTML (ERB, Haml and Slim) views in a Rails application without editing the underlying view.

Deface is a library that allows you to customize HTML (ERB, Haml and Slim) views in a Rails application without editing the underlying view.

It allows you to easily target html & erb elements as the hooks for customization using CSS selectors as supported by Nokogiri.

63 questions
1
vote
1 answer

Defacing Spree using partial as source

I am trying to add fields to spree admin using deface. I followed their tutorial, but they were inserting html using string. I tried to move that string into a html.erb file and reference the source as a partial, and got the following…
harinsa
  • 3,176
  • 5
  • 33
  • 53
1
vote
1 answer

Spree Commerce: Associate line items in the cart?

I am writing a Spree extension to allow certain items in the cart/order to be linked to each other. A "setting" product can be associated with a "center stone" product. Eventually, there shall be constraints enforcing which things can reference…
Jessa
  • 1,549
  • 2
  • 12
  • 26
1
vote
0 answers

How to deface the product form in spreecommerce admin panel?

I'm trying to deface the product form in spreecommerce admin panel. I have 5 taxonomies and many taxons. Adding all of them from a form is getting difficult. So, I'm trying add different fields for the taxons in each taxonomy. ie, there will be 5…
thatkid
  • 41
  • 7
1
vote
2 answers

Deface _products data-hook

I want to add taxonomies from sidebar to main page, instead of list of products, but my deface is not working. Deface::Override.new( :virtual_path => 'spree/shared/_products', :name => 'change view', :replace =>…
iiukyr4uk
  • 35
  • 3
1
vote
2 answers

Use deface to change bad code in Spree store

I am working in Spree, and I am trying to use Deface to change this <% if order.has_step?("delivery") %>
<%= Spree.t(:shipping_address) %> <%= link_to "(#{Spree.t(:edit)})",…
Gogglor
  • 115
  • 7
1
vote
1 answer

How to add class to html element with Deface?

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
user2609980
  • 10,264
  • 15
  • 74
  • 143
1
vote
1 answer

Deface in spree home index

I'm trying to add some content i spree's home#index using Deface's DSL. I have a file at app/overrides/spree/home/index/add_home_index_steps.html.erb.deface with the following content: <%= render :partial =>…
StrikerFred
  • 105
  • 5
1
vote
1 answer

Rails Deface on input erb element, cannot override it correctly

I am trying to override the qty input element in the products/_cart_form , to avoid a user modifying the qty Should the Deface override be performed on the erb code or the html I used the following override wo any success seems to be a mix of html…
user762579
1
vote
1 answer

remove element by data-erb-id

I can't remove element by data-erb-id. Here a code from http://deface.heroku.com/:

form.label :address1, t(:street_address)

Capacytron
  • 3,425
  • 6
  • 47
  • 80
1
vote
1 answer

Silence Deface log output

I am getting a crap-ton of log noise from Deface. I'm not the view guy on my current project and I'd really like to remove that crap from the logs. I'd also imagine that on a live production application you'd want to silence or suppress that as…
jaydel
  • 14,389
  • 14
  • 62
  • 98
0
votes
0 answers

How to get the content of the string being replaced with deface library, before the replacement

I want replace in *.erb files tag using spree/deface library in rails. Replacing work fine. But I want get override string before it will override and get attribute "name" for example. I want use some attribute from old string in new string. For…
Nepobo
  • 1
0
votes
1 answer

Rails 4.2 overriding views. Is Deface really standalone?

I'm trying to override view with Deface. In manual creators called it standalone, so I guess that it's possible to use this gem without using spree... But I'm not sure anymore because nearly every tutorial/question/anything I found about Deface was…
zekorius
  • 5
  • 4
0
votes
1 answer

How to spree sidebar of admin using deface?

Deface::Override.new(:virtual_path => 'admin/shared/_sidebar',:name => 'blog',:insert_after =>'#main-sidebar',:text => 'text message') Please help me with this.
user2256233
0
votes
1 answer

Using Spree Deface Overrides, how do I change the css class of a submit tag?

So in my code I have the following on line 14: app/views/spree/shared/_search.html.erb <%= submit_tag Spree.t(:search), name: nil, class: "btn btn-danger" %> and in: app/overrides/edit_header.rb Deface::Override.new( :virtual_path =>…
Okomikeruko
  • 1,123
  • 10
  • 22