Skip to content

Instantly share code, notes, and snippets.

@willrust
Created December 15, 2014 03:40
Show Gist options
  • Select an option

  • Save willrust/dac218f04d69b2be6533 to your computer and use it in GitHub Desktop.

Select an option

Save willrust/dac218f04d69b2be6533 to your computer and use it in GitHub Desktop.
ActiveAdmin Doorkeeper Resource
ActiveAdmin.register Doorkeeper::Application do
permit_params :name, :redirect_uri
# ActiveAdmin will name Rails Engine models with their namespaced names (ex:doorkeeper_application) which
# will fail validation and spit back a form with errors where the fields would otherwise be valid.
# Setting the model resource name back to 'application'.
controller do
resources_configuration[:self][:instance_name] = 'application'
end
index do
selectable_column
id_column
column :name
column :uid
column :secret
column :redirect_uri
column :created_at
actions
end
filter :name
filter :uid
filter :secret
filter :redirect_uri
filter :created_at
form do |f|
f.inputs "API Application Details" do
f.input :name
f.input :redirect_uri
end
f.actions
end
end
@varunjuneja
Copy link
Copy Markdown

Gives "undefined method `per_page_kaminari' for #<Doorkeeper::Application::ActiveRecord_Relation"
How to resolve that ?

@bellef
Copy link
Copy Markdown

bellef commented Feb 22, 2018

Same here, if someone has a solution I think it may be linked in some way to the will_paginate gem.

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