fishbrain/administrate-field-belongs_to_search

Missing template for search

nate-r-a opened this issue · 2 comments

Hi folks, I'm having some trouble getting this plugin working. My resource_dashboard.rb includes this under ATTRIBUTE_TYPES:

address: Field::BelongsToSearch.with_options(
  class_name: "Address"
),

But when I type into the search bar, nothing happens and I get this error in the logs:

ActionView::MissingTemplate - Missing template admin/addresses/index, admin/application/index, administrate/application/index with {:locale=>[:en], :formats=>[:json], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :arb, :coffee, :haml]}. Searched in:
  * "/Users/nate-r-a/my-org/my-project/app/views"
  * "/Users/nate-r-a/.rvm/gems/ruby-2.3.8/gems/administrate-field-belongs_to_search-0.6.0/app/views"
  * "/Users/nate-r-a/.rvm/gems/ruby-2.3.8/gems/administrate-0.11.0/app/views"

, etc.

Did I miss a part of the setup, or maybe misunderstanding how this is to be used? Thanks in advance!

Interesting! It seems like you are missing a template handler for the JSON format, which this project relies on. What version of Administrate and Rails are you using?

If you add jbuilder to your Gemfile, does that fix it for you?

I had this same issue. I see that jbuilder is a dependency of this gem. But why did I need to add it to the Gemfile explicitly?