You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Components now inherit from ActionView::Component::base
1
+
*The `render_component` test helper has been renamed to `render_inline`. `render_component` has been deprecated and will be removed in v2.0.0.
2
2
3
3
*Joel Hawksley*
4
4
5
+
* Components are now rendered with `render MyComponent, foo: :bar` syntax. The existing `render MyComponent.new(foo: :bar)` syntax has been deprecated and will be removed in v2.0.0.
6
+
7
+
*Joel Hawksley*
8
+
9
+
# v1.1.0
10
+
11
+
* Components now inherit from ActionView::Component::Base
The following syntax has been deprecated and will be removed in v2.0.0:
147
+
148
+
`render(TestComponent.new(foo: :bar)`
149
+
138
150
#### Error case
139
151
140
152
If the component is rendered with a blank title:
141
153
142
154
```erb
143
-
<%= render(TestComponent.new(title: "")) do %>
155
+
<%= render(TestComponent, title: "") do %>
144
156
Hello, World!
145
157
<% end %>
146
158
```
@@ -151,7 +163,7 @@ An error will be raised:
151
163
152
164
### Testing
153
165
154
-
Components are unit tested directly. The `render_component` test helper renders a component and wraps the result in `Nokogiri.HTML`, allowing us to test the component above as:
166
+
Components are unit tested directly. The `render_inline` test helper wraps the result in `Nokogiri.HTML`, allowing us to test the component above as:
155
167
156
168
```ruby
157
169
require"action_view/component/test_helpers"
@@ -162,7 +174,7 @@ class MyComponentTest < Minitest::Test
0 commit comments