LoginSignup
0
0

More than 1 year has passed since last update.

param is missing or the value is empty: の原因

Last updated at Posted at 2021-07-31

結論 「無駄な記述」

初学者あるあるかと思いますが、今まで作ったものを基準に。そしてお手本にしながら作成をしていたから起きたエラーなのかなと思います。

 エラーの原因について詳しく

こちらが、お手本にしていたスクールで作成したものです。

<%= form_with model: @purchase_address, url: item_purchases_path,  id: 'charge-form', class: 'transaction-form-wrap', local: true do |f| %>

自分が記述していたコード

  <%= form_with model: @sum_exp, url: skill_sum_exps_path,   id:'charge-form', class:'transaction-form-wrap', local: true do |f| %>

解説

エラーの原因は id: 'charge-form' でした。 
これはスクールで作っていた クレジットカード決済の処理をJavaScriptでする為に必要なidの記述であって、フォームを送る処理には不必要な記述という事です。

スクールでの学習はついつい受け身になってしまい、いざ自分で作成するとこのようなエラーが起きるんですね。
自分で作るって大事ですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0