ruby
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ruby [2026/03/14 16:47] – reddy | ruby [2026/03/15 19:56] (current) – reddy | ||
|---|---|---|---|
| Line 73: | Line 73: | ||
| rm storage/ | rm storage/ | ||
| rails db:drop db:create db:migrate | rails db:drop db:create db:migrate | ||
| + | </ | ||
| + | |||
| + | ==== Turbo Frames ==== | ||
| + | |||
| + | Turbo frames are for partial view updates. When the view is being rendered, return content within the turbo frame tag with the same identifier. domid(model_object) can be used to generate an identifier. | ||
| + | |||
| + | < | ||
| + | # In home/index view | ||
| + | <%= turbo_frame_tag " | ||
| + | This is a thing | ||
| + | <%= link_to ' | ||
| + | <% end %> | ||
| + | |||
| + | # In home/info view | ||
| + | <%= turbo_frame_tag " | ||
| + | This is another thing | ||
| + | <%= link_to ' | ||
| + | <% end %> | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Turbo Streams ==== | ||
| + | |||
| + | < | ||
| + | # In the view | ||
| + | <%= turbo_stream_from " | ||
| + | <div id=" | ||
| + | |||
| + | # In a controller | ||
| + | Turbo:: | ||
| + | ' | ||
| + | target: ' | ||
| + | content: DateTime.now | ||
| + | ) | ||
| </ | </ | ||
ruby.1773503236.txt.gz · Last modified: by reddy
