问题描述
我已从 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:install
和 rails hotwire:install
还是我在 turbo frame 标签中遗漏了什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)