Skip to content

Commit 42a4d19

Browse files
committed
Revert "Add dynamic html id to Matestack pages"
1 parent 0924a29 commit 42a4d19

File tree

2 files changed

+2
-41
lines changed

2 files changed

+2
-41
lines changed

docs/ui-in-pure-ruby/overview.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,6 @@ end
144144
```
145145
{% endcode %}
146146

147-
Both the controller and action names will be dynamically added to the `id` attribute of the page's root element, allowing CSS rules to directly target specific pages, and tests to easily locate the page's content.
148-
149-
For example, the above controller code will result in the following HTML markup:
150-
151-
```markup
152-
<div id="matestack-page-some-controller-overview" class="matestack-page-root">
153-
<!-- page content -->
154-
</div>
155-
```
156-
157147
Learn more about Pages:
158148

159149
{% page-ref page="pages/" %}

spec/test/base/core/page/rendering_spec.rb

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,12 @@
66
before :all do
77
Rails.application.routes.append do
88
scope "page_rendering_components_spec" do
9-
get '/page_rendering_test', to: 'page_rendering_test#my_action'
9+
get '/page_test', to: 'page_test#my_action', as: 'rendering_page_test_action'
1010
end
1111
end
1212
Rails.application.reload_routes!
13-
14-
class ExamplePageRendering < Matestack::Ui::Page
15-
def response
16-
div do
17-
plain "ExamplePage"
18-
end
19-
end
20-
end
21-
22-
class PageRenderingTestController < ActionController::Base
23-
include Matestack::Ui::Core::Helper
24-
25-
def my_action
26-
render ExamplePageRendering
27-
end
28-
end
2913
end
3014

31-
before :each do
32-
visit "page_rendering_components_spec/page_rendering_test"
33-
end
34-
35-
it "wraps content with a specific dom structure" do
36-
expect(page).to have_xpath('//div[@id="matestack-ui"]/div[@class="matestack-page-container"]/div[@class="matestack-page-wrapper"]')
37-
end
15+
it "wraps page content with a specific dom structure"
3816

39-
it "renders its root element with a dynamic id composed of {controller} and {action}" do
40-
expect(page).to have_xpath('//div[@id="matestack-page-page-rendering-test-my-action"]')
41-
end
42-
43-
it "renders its root element with a specific class" do
44-
expect(page).to have_xpath('//div[@class="matestack-page-root"]')
45-
end
4617
end

0 commit comments

Comments
 (0)