2020-11-07から1日間の記事一覧
permit_paramsに、 子モデルの「名称」と「属性」を指定すればOKです。 例えば、 下記のようなモデルがあるとします。 # 親 class Plan attribute :name attribute :price has_many :contracts end # 子 class Contract belongs_to :plan end この場合、 Act…
panel do〜endブロックの中に、 f.inputを入れてあげればOKです。 form do |f| panel '次月プラン' do f.input :name f.input :id end end するとこんな感じになります。 f:id:mah666hhh:20201107111535p:plain nameのラベルは、 I18nで翻訳が当たっているの…
config.clear_action_items! の1行を追加すればOKです。 ActiveAdmin.register Item do # これを追加 config.clear_action_items! end これで、 ヘッダータイトルの作成ボタンが非表示になりました。 f:id:mah666hhh:20201107092354p:plain clear_action_ite…