DBに関係ないフォームを作成し、非同期通信で処理するようにしたいです。
Expected a URI like gid://app/Person/1234: #<URI::GID:0x007ffc9d6c0c40 URL:gid://xxxxx>というエラーが出てしまいます。
![イメージ説明]WIDTH:600
lang
1class InquiryController < ApplicationController 2 3 def index 4 @inquiry = Inquiry.new 5 render :action => 'index' 6 end 7 8 def confirm 9 @inquiry = Inquiry.new(inquiry_params) 10 if @inquiry.valid? 11 render :action => 'confirm' 12 else 13 render :action => 'index' 14 end 15 end 16 17 def thanks 18 @inquiry = Inquiry.new(inquiry_params) 19 20 # send mail 21 InquiryMailer.received_email(@inquiry).deliver_later 22 23 24 flash[:notice] = "お問い合わせ頂き、ありがとうございました。" 25 render :action => 'thanks' 26 end 27 28 private 29 def inquiry_params 30 params.require(:inquiry).permit(:name, :email, :type, :message) 31 end 32 33 34 35end 36
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。