Skip to content

Commit a793672

Browse files
author
Kai Wood
committed
Update README.md to hint for the custom HTML attributes
1 parent e8420c5 commit a793672

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,14 @@ Components can also be prerendered directly from a controller action with the cu
212212
class TodoController < ApplicationController
213213
def index
214214
@todos = Todo.all
215-
render component: 'TodoList', props: { todos: @todos }, tag: 'span'
215+
render component: 'TodoList', props: { todos: @todos }, tag: 'span', class: 'todo'
216216
end
217217
end
218218
```
219219

220220
This custom renderer behaves the same as a normal view renderer and accepts the usual arguments - `content_type`, `layout`, `location` and `status`.
221-
By default, your current layout will be used and the component, rather than a view, will be rendered in place of `yield`.
221+
By default, your current layout will be used and the component, rather than a view, will be rendered in place of `yield`. Custom data-* attributes
222+
can be passed like `data: {remote: true}`.
222223

223224
### Component generator
224225

0 commit comments

Comments
 (0)