Basic turbo todo list implementation
Based on: https://webcrunch.com/posts/digging-into-turbo-with-ruby-on-rails-7
This commit is contained in:
7
app/views/todos/create.turbo_stream.erb
Normal file
7
app/views/todos/create.turbo_stream.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<%= turbo_stream.prepend "todos" do %>
|
||||
<%= render "todo", todo: @todo %>
|
||||
<% end %>
|
||||
|
||||
<%= turbo_stream.replace "#{dom_id(Todo.new)}_form" do %>
|
||||
<%= render "form", todo: Todo.new %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user