Friday, 12 November 2021

Active admin textbox/search functionality for selecting

 Add gem: 

gem 'activeadmin-searchable_select'

Import stylesheets and require javascripts:

// active_admin.scss
@import "active_admin/mixins";
@import "active_admin/base";

// active_admin.js
//= require active_admin/base
Add admin site in form field
f.input :account_id, as: :searchable_select, collection: AccountBlock::Account.all.map { |s| [s.profile.try(:name), s.id]}

Add ckeditor in active admin site

 


Gemfile: gem 'ckeditor'

active_admin.rb:  config.register_javascript "https://cdn.ckeditor.com/4.16.1/standard/ckeditor.js"

 admin_input:  f.input :contract, :input_html => { :class => "ckeditor" , :height => 400}