vendredi 10 février 2017

Edit form checkbox, radio and trix editor not getting pre-populated in ActiveAdmin

I have a form which has checkboxes, trix editor, radio button and text fields. When I edit the record in admin interface, form is shown with all text fields. Am not able to see trix editor, checkboxes and radio buttons.

I know as: :radio and as: :check_boxes and as: :trix_editor should work but they are not getting pre populated with already saved values

Here is my jobposting.rb file.

Any help will be really appreciated.

ActiveAdmin.register JobPosting do

# See permitted parameters documentation:
# http://ift.tt/1D5Mw8G
#
permit_params :title, :description,:how_to_apply, :job_type ,:city,:user_id, :categories, :publish
#
# or
#
# permit_params do
#   permitted = [:permitted, :attributes]
#   permitted << :other if params[:action] == 'create' && current_user.admin?
#   permitted
# end


form do |f|
    f.inputs "New Job Posting" do
      f.input :title
      f.input :description
      f.input :how_to_apply
      f.input :job_type
      f.input :city
      f.input :user_id
      f.input :categories

      f.input :publish


    end
    f.actions
  end


end

This is how the screen is rendering

enter image description here

Aucun commentaire:

Enregistrer un commentaire