0
votes

I am new to Spree. I want to deface link_to rails helper.

i have spree/checkout/_new_user file and it contain following:

<%= link_to Spree.t(:login_as_existing), spree.login_path %>

i want to add remote: true to above link_to using deface.

Please Help.

1

1 Answers

1
votes

You can replace links

Deface::Override.new(virtual_path: 'checkout/_new_user', 
                         name: 'add remote true to link", 
                         replace: "erb[loud]:contains('link_to Spree.t(:login_as_existing), spree.login_path'), 
                         text: "<%= link_to Spree.t(:login_as_existing), spree.login_path, remote: true %>")