简体   繁体   中英

How to display a tableless model on rails admin dashboard

I am trying to display a particular model on dashboard (which does not have backend table ) but unable to do so.

The rails admin code does not picks it up and does not gets displayed on dashboard.

I have already defined the model configuration inside RailsAdmin initializer file.

Please suggest what could be missing here.

Thanks in advance.

If you're trying to use a model without a table you can do this:

class YourModelName
  include ActiveModel::Model

  ...
  # Your code goes here, make sure you leave the persisted? method


  def persisted?
    false
  end
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM