railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.89k stars 2.26k forks source link

undefined method `js_location' #3333

Closed stephenZ22 closed 3 years ago

stephenZ22 commented 3 years ago

image

# config/initializers/rails_admin.rb
    config.model 'Post' do
      field :content do
        js_location { bindings[:view].asset_pack_path 'actiontext.js' }
      end
    end
# app/javascript/packs/actiontext.js
   require("trix")
   require("@rails/actiontext")

My model Post(id: integer, title: string, content: text, created_at: datetime, updated_at: datetime)

stephenZ22 commented 3 years ago

Don't use existing column