File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 203
203
- On MRI, you'll get a deadlock with ` pool_size ` > 1
204
204
- If you're using JRuby, you can increase ` pool_size ` to have real multi-threaded rendering.
205
205
206
+ ### Rendering components instead of views
207
+
208
+ Beginning in ` ~> 1.3.0 ` components can be rendered directly from a controller action with the custom ` component ` renderer. For example:
209
+
210
+ ``` ruby
211
+ class TodoController < ApplicationController
212
+ def index
213
+ @todos = Todo .all
214
+ render component: ' TodoList' , props: { todos: @todos }
215
+ end
216
+ end
217
+ ```
218
+
219
+ The component will be rendered in place of ` yield ` .
220
+
206
221
### Component generator
207
222
208
223
` react-rails ` ships with a Rails generator to help you get started with a simple component scaffold.
You can’t perform that action at this time.
0 commit comments