Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Search select doesn't work with non resource form #478

Open
mrudult opened this issue Aug 18, 2023 · 1 comment
Open

[BUG]: Search select doesn't work with non resource form #478

mrudult opened this issue Aug 18, 2023 · 1 comment
Labels

Comments

@mrudult
Copy link

mrudult commented Aug 18, 2023

Given the following custom page:

ActiveAdmin.register_page "Invite Account" do
  content do
    active_admin_form_for :invitation, url: invite_account_admin_accounts_path, method: :post do |f|
      f.inputs do
        f.input :first_name, label: 'First name', required: true
        f.input :last_name, label: 'Last name'
        f.input :email, label: 'Email', required: true
        f.input :post_id, as: :search_select, url: proc { admin_posts_path }, fields: [:post_name], display_name: "post_name", order_by: "post_name_asc"
      end
      f.actions do
        f.action :submit, label: 'Submit'
      end
    end
  end
end

Throws error:

ActionView::Template::Error (blank object given):
1: # frozen_string_literal: true
2: insert_tag active_admin_application.view_factory["page"]

app/admin/pages/invite_account.rb:8:in block (4 levels) in <main>' app/admin/pages/invite_account.rb:4:in block (3 levels) in

'
app/admin/pages/invite_account.rb:3:in `block (2 levels) in '

The search_select_filter works fine. Any help will be appreciated.

@mrudult mrudult added the bug label Aug 18, 2023
@imsinu9
Copy link

imsinu9 commented Sep 30, 2023

@mrudult you may want pass @object (@invitation || resource) rather :invitation below:
active_admin_form_for :invitation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants