rails admin can not search if total objects goes to more than 450 records on create new object screen

28 Views Asked by At

I am attempting to create a new object for the "Roster" model using Rails Admin. A "Roster" belongs to a "Team," so when creating a new "Roster," it is essential to select the specific team for which the roster is intended.

Currently, I can successfully search for teams in the database, but I encounter issues when trying to search for teams beyond the first 450 records. This limitation is affecting my ability to find and select teams when creating a new "Roster" in Rails Admin.

Model structure

    class Team < ApplicationRecord
        has_many :rosters
     end 
    class Roster < ApplicationRecord
       belongs_to :team
    end

I've noticed that the search functionality is managed by the gems/rails_admin-3.1.2/app/views/rails_admin/main/_form_field.html.erb gem file. It appears that this file loads all the teams during the page load, but there seems to be a limitation where it loads only the first 450 records and skips the rest.

Is there anyone who could assist me in modifying this behavior to make it possible to search through all the available records? Rails version: 7.0.x Ruby version: 3.1.2

0

There are 0 best solutions below