0

I am while customizing my spree e-commerce application. At first I added the spree_bootstrap_frontend gem and I want to customize the oredres/edit view as follow:

Deface::Override.new(:virtual_path =>"spree/orders/edit",
                     :name => "continue_shopping",
                     :replace => "erb[loud]:contains('link_to t(:continue_shopping), products_path')",
                     :erb => "<%= link_to t(:continue_shopping), products_path, :class => 'btn btn-primary' %>")

but there's no change. Could you please help my first customization view?

amphetamachine
  • 27,620
  • 12
  • 60
  • 72
mimou
  • 65
  • 10

1 Answers1

0

I think you should just use :text key instead of :erb:

Deface::Override.new(:virtual_path =>"spree/orders/edit",
                     :name => "continue_shopping",
                     :replace => "erb[loud]:contains('link_to Spree.t(:continue_shopping), products_path')",
                     :text => "<%= link_to t(:continue_shopping), products_path, :class => 'btn btn-primary' %>")
kennyadsl
  • 706
  • 6
  • 10
  • which versions of `spree` and `spree_bootstrap_frontend` are you using? – kennyadsl Mar 02 '15 at 09:04
  • I am using using spree '2.4.3' and gem 'spree_bootstrap_frontend', github: '200Creative/spree_bootstrap_frontend', branch: 'master' – mimou Mar 02 '15 at 09:21
  • As you can see here: https://github.com/200Creative/spree_bootstrap_frontend/blob/490c13e5669edab6f1631ef74b59f975a1b523f5/spree_bootstrap/frontend/app/views/spree/orders/edit.html.erb#L9 the erb you are trying to find in the page is different from the one present in the extension. I think it's just matter to update the `t` method with the `Spree` namespace. Going to update the answer :) – kennyadsl Mar 02 '15 at 09:28
  • yes that's true! I change the 't' method by 'Spree.t' method and it works thank you :) – mimou Mar 02 '15 at 09:34