【進捗報告20200713】
本日の作業
【active_hash】
関連付け
class Destination < ApplicationRecord
<追加>
extend ActiveHash::Associations::ActiveRecordExtensions
belongs_to_active_hash :prefecture
<追加/>
belongs_to :user, optional: true
省略
セレクトボックスの作成
.field
%span.required 【必須】
%br/
= f.select :prefecture_id,
Prefecture.all.map { |pre| [pre.name, pre.id] },
{include_blank: "選択する"}
・選択してない状態がないので{include_blank: "選択する"}を追加
(配列の後ろに書くものだと思い込んでてprefecture.rbに書いたりしてました)
・入力後、記入漏れと出てしまいページ遷移しないので
registrations_controller.rb
destination_paramsのprefectureに_idをつける
完成
昨日まで何時間も悩んでたものがあっさり終わった日だった
明日マージできればマークアップかな