0

After successful submit it should reload the page (_top) instead it appends the pages index to the html tag.

application.js

import "@hotwired/turbo-rails"

application.html.erb

<a data-turbo-frame="modal" href="/page/new">New Page</a>
<%= turbo_frame_tag :modal %>

pages/new.slim

= turbo_frame_tag :modal do
  = simple_form_for :page, url: pages_path, data: { turbo_frame: '_top' } do |f|
    = f.input :title
    = f.button :submit

pages_controller.rb

def create
  ...
  redirect_to pages_path
  ...
end
Eyeslandic
  • 14,553
  • 13
  • 41
  • 54
Oliver
  • 801
  • 13
  • 26

0 Answers0