![]() spree/admin/slides/_ the first argument for the rake task, it's the layout that contains the ERB sentence we’re trying to find.deface:test_selector is the rake task we are executing. ![]() "erb:contains('f.field_container :slide_locations')"] The rake task will be: bundle exec rake deface:test_selector["spree/admin/slides/_", To do it, select the line 48 from the file that contains the following: Finding the ERBĪfter the setup, let’s analyze the view we are trying to select from. Oh, and also, we will be using the layout spree/admin/slides/_ from the solidus_slider gem to test our ERB selectors. Here is important for you to know that this task takes two arguments: 1] the layout that contains the element you’re trying to find, and 2] the selector you will be using to find it. To do it, we will be using the test_selector rake task provided by Deface. To set it up, we need a quick and easy way to test the selectors. It allows you to easily target HTML & ERB elements as the hooks for customization using CSS selectors as supported by Nokogiri. From their Github page:ĭeface is a library that allows you to customize HTML (ERB, Haml, and Slim) views in a Rails application without editing the underlying view. Having trouble finding a selector to override a view? Here in this blog post, we show you a simple way to use ERB syntax on Deface DSL.īefore learning how to use ERB syntax as a selector on Deface, let's explain what Deface is.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |