0

我已从 rails 6.0 升级到 rails 6.1 并尝试使用 Hotwire,但在尝试运行我的应用程序时出现错误:

wrong number of arguments (given 0, expected 1..4)
Extracted source (around line #1):
  <%= turbo_frame_tag 'branch' do %> 

我在edit.html.erb中的代码:

<%= turbo_frame_tag 'post' do %> 
   <h3>Edit post</h3>
       <%= render 'form', post: @post %>
<% end %>

我的 _form.html.erb 中的代码:

<%= form_with(model: post, local: true) do |form| %>
  <% if post.errors.any? %>
    <h5><%= pluralize(post.errors.count, "error") %> prohibited this post from being saved:</h5>
      <ul class="browser-default">
        <% post.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
      </ul>
  <% end %>

  <div class="form-field">
    <div class="input-field">
      <%= form.text_field :title %>
      <%= form.label :title %>
    </div>
  </div>

  <br>

  <div class="form-field">
    <div class="input-field">
      <%= form.text_field :description %>
      <%= form.label :description %>
    </div>
  </div>


  <div class="actions"><%= submit_tag "Submit", :type=>"submit", :class=>"btn", :data => { :disable_with => "Processing" } %></div>
<% end %>

我的 show.html.erb 中的代码:

<%= turbo_frame_tag 'branch' do %> 
   <h3><%= @post.title %></h3>
   <p><%= @post.description %></p>
<% end %>

有人知道我在升级过程中可能错过了什么吗?我跑了rails turbo:installrails hotwire:install还是我在涡轮框架标签中遗漏了什么?

4

0 回答 0