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
8
votes
3 answers

Themeing a Spree installation; causing a Deface nightmare

Typed this up at Programmers.SE first, but imagine this may be better suited to here - purely because it's not asking for a advice regarding a specific technical issue. Feel free to vote to move though! I'm currently working on a project using the…
Fergus In London
  • 1,203
  • 8
  • 19
4
votes
2 answers

Spree deface email text template

I am trying to insert a text after checkout email message. I'm found template in spree/order_mailer/confirm_email.text.erb <%= Spree.t('order_mailer.confirm_email.dear_customer') %> <%= Spree.t('order_mailer.confirm_email.instructions')…
Ilya Krigouzov
  • 271
  • 2
  • 16
3
votes
1 answer

Override Spree Admin views with Deface

I'm trying to add a few lines to Spree admin. File I would like to override: backend/app/views/spree/admin/orders/_shipment.html.erb I want to add it here: …
neo
  • 4,078
  • 4
  • 25
  • 41
3
votes
1 answer

Spree Deface, can select anything but a class

I'm trying to use Deface to add a button in a column in a table in Spree Admin. But I just can't get my CSS-like selector right. I can select the table row using a data-hook, and can select child elements (eg td, span), but can't select by a…
David Cook
  • 483
  • 7
  • 25
3
votes
1 answer

Overriding a view in Spree with deface: how do I add inputs and their current values?

I'm trying to add an input to a form that already exists in one of the Spree admin views. Here's the override text (I cut out some cruft that was display centric and noisy): new_html = "
jaydel
  • 14,389
  • 14
  • 62
  • 98
2
votes
1 answer

Deface on spree to override an image

I'm new to Ruby on Rails and I'm developing a smal e-commerce website based on the spree gem. However I wanted to update/override the front-end part of the website using the spree deface library. Deface::Override.new(:virtual_path =>…
2
votes
0 answers

deface gem trying to modify frozen array "eager_load_paths" when running in production

I'm trying to deploy my spree project to heroku, but I'm getting the following error message: "Unable to load application: RuntimeError: can't modify frozen Array" Using the backtrace, this is because deface is calling reject! method on…
RyanQuey
  • 705
  • 1
  • 9
  • 29
2
votes
1 answer

spree overriding nav_bar menu

I am trying to customize my spree application: I override the nav bar menu like follow: Deface::Override.new(:virtual_path =>"spree/shared/_nav_bar", :name => "main_menu", :replace =>"nav#top-nav-bar", …
mimou
  • 65
  • 10
2
votes
0 answers

Passing variables (locals) into a partial when rendering a partial from Deface

I have a deface declaration, that adds a partial to every page just above . Deface::Override.new( :virtual_path => 'spree/layouts/spree_application', :name => 'add_piwik_tracking_tag_to_layout', :insert_bottom => "[data-hook='body']", …
berkes
  • 26,996
  • 27
  • 115
  • 206
1
vote
0 answers

Raise an error and/or unit test if the Spree Deface Original Changed?

Currently Spree Deface will log an error if the original view changes. For example: Deface: [ERROR] The original source for 'spree/foo' has changed, this override should be reviewed to ensure it's still valid. Does anyone know of way to raise an…
Chris C
  • 373
  • 7
  • 17
1
vote
1 answer

Deface issue with virtual_path in engines

I'm working on an rails app with several mountable engines. I use the deface gem to override some part of views but I'm having some issues to update some of them. I don't know if it's a problem or a mistake that I'm making but it seems like deface…
1
vote
1 answer

Adding an image with Deface::Override to Spree

I was able to insert some text after a
by using a Deface::Override but now I want to add an image of a QR code instead of text. How would you change this code to work for an image? My original code that successfully added text is the first…
1
vote
0 answers

RSpec - Allow any instance of ENV to receive

I'm testing controller with view overwritten with deface (no DSL) and I have a problem... In deface file I'm fetching parameter from ENV and because of that my tests are failing. Deface file: if ENV.fetch('something', nil).present? …
kamikod
  • 67
  • 6
1
vote
0 answers

Using h3 tag in place of spree logo makes formatting go awry

Deface::Override.new(:virtual_path => "spree/layouts/admin", :name => "backend_logo", :replace => 'erb[loud]:contains("spree/admin/shared/header")', :partial => "layouts/backend_navbar") I made a partial in layouts by copying the…
SlurpDerp
  • 11
  • 4
1
vote
2 answers

Decision about when to use Deface for Spree (Rails) and when not?

I am working on a Rails E-Commerce store using Spree. There are two ways to edit front-end. using Deface Working with default views I know that with Deface we have Spree upgrading facilities. But when I think about using Deface, I am little…
omair azam
  • 520
  • 7
  • 14
1
2 3 4 5