diff --git a/hotwire-tw-demo/app/controllers/emotions_controller.rb b/hotwire-tw-demo/app/controllers/emotions_controller.rb index 805e1b6..98b1d57 100644 --- a/hotwire-tw-demo/app/controllers/emotions_controller.rb +++ b/hotwire-tw-demo/app/controllers/emotions_controller.rb @@ -11,7 +11,7 @@ def create if @emotion.save redirect_to action: :index else - render :index + render :index, status: :unprocessable_entity end end @@ -40,7 +40,7 @@ def show def destroy @emotion.destroy - redirect_to action: :index + redirect_to action: :index, status: :see_other end def like diff --git a/hotwire-tw-demo/app/javascript/application.js b/hotwire-tw-demo/app/javascript/application.js index cb95780..3016c21 100644 --- a/hotwire-tw-demo/app/javascript/application.js +++ b/hotwire-tw-demo/app/javascript/application.js @@ -2,4 +2,3 @@ import "@hotwired/turbo-rails" import "./controllers" import * as bootstrap from "bootstrap" -Turbo.session.drive = false diff --git a/hotwire-tw-demo/app/views/emotions/_new.html.erb b/hotwire-tw-demo/app/views/emotions/_new.html.erb index ead7f8d..c650f41 100644 --- a/hotwire-tw-demo/app/views/emotions/_new.html.erb +++ b/hotwire-tw-demo/app/views/emotions/_new.html.erb @@ -9,7 +9,7 @@ <% end %> - <%= form_with model: @emotion || Emotion.new, local: true do |form| %> + <%= form_with model: @emotion || Emotion.new do |form| %>