Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
181 views

How to append param at end of every route active admin

I am struggling to add param at the end of every route in active admin any idea how it can be done?? For example /admin/edge?journey=1 i want journey param to be appended to all actions urls Any help ...
ronaksharma's user avatar
1 vote
1 answer
42 views

Active admin column with do and without do are they same in performance

column 'Name' do |c| c.name end column :name Are they same in execution time and performance wise ? Any of them is good for better performance ?
Bilal Ahmed's user avatar
0 votes
1 answer
716 views

Custom filter to active admin to extract multiple rows on Index page

I have a working code that filter out one row of if the conditions are met ransacker :custome_search, formatter: proc { |v| user = Util.new(param: v.strip).user. # gets the data from an external ...
Lucas's user avatar
  • 33
1 vote
1 answer
1k views

Rails ActiveAdmin active_admin_form_for submit button disabled

I have a form where has many nested forms with submit button for each. I want to disable some submit buttons according to a certain condition. but I couldn't find such property. Here is my code: ...
Ahmed Salah's user avatar
0 votes
1 answer
367 views

Active Admin: How to Left align buttons by default

as it is explained in the following image. Active admin buttons are right align by default. I want to align them to left by default, is there any setting in Active Admin to achieve this ?
kashif's user avatar
  • 1,147
0 votes
1 answer
355 views

Override class in ActiveAdmin index

I am using ActiveAdmin Flat Skin as template and I want to highlight some rows of the index page depending on an attribute of the row. The index page shows even odd rows displaying even rows with a ...
marimaf's user avatar
  • 5,420
3 votes
1 answer
870 views

ActiveAdmin very slow in development environment

I have an app that use ActiveAdmin gem. We have actually 3 namespace and more than 100 ActiveAdmin.register Model rails 5.0.7 activeadmin 2.4 The app run pretty well in production, however when we ...
baptibenz's user avatar
  • 121
2 votes
0 answers
197 views

How do I add and remove field dynamically in active admin rails

I want to create a form with some fix fields and some fields with add button which create new text box every time when I hit add button, is it possible in active admin rails
Adwait soni's user avatar
0 votes
0 answers
22 views

Set the field as required in ActiveAdmin [duplicate]

I am using this form below in admin portal to create a new record but somehow required: true is not working. I have using rails 5. Any idea where I could be going wrong? ActiveAdmin.register Workers ...
user12763413's user avatar
  • 1,347
0 votes
1 answer
230 views

filter dropdown appear as object in Active Admin in rails 5

ActiveAdmin.register Type do permit_params :name, :job, version_ids: [] index do id_column column :name column :job column :versions do |type| type....
user12763413's user avatar
  • 1,347
0 votes
0 answers
693 views

multiple selection using the activeadmin gem

I am developing my application in ruby on rails 5 and I am using the activeadmin gem for the CRUD of records, I have a field that the user can select multiple records, I need it to be saved as an ...
jeff's user avatar
  • 377
0 votes
1 answer
186 views

unable to save data active admin slef association rails 5.2

DB structure id | name | category_id(parent_id) | when I try to save the data using active admin it gives me below error message, please find below details along with model. processing by Admin::...
Adwait soni's user avatar
0 votes
1 answer
886 views

Active admin custom index with instant method column

i have a user model class User < ApplicationRecord has_many :payments, dependent: :destroy has_many :debts, dependent: :destroy def balance @balance = self.payments.sum(:amount) - self.debts.sum(:...
Rezakael's user avatar
1 vote
0 answers
140 views

active admin editor is not uploading form successfully

ActiveAdmin Trumbowyg is not working properly. I have added upload option using it and uploaded file as per code give here. It successfuly uploads the file, but it is not inserted inside text area. ...
adi's user avatar
  • 25
0 votes
1 answer
352 views

How to select a model field to represent a many to one relationship on active admin dashboard?

I am building an eCommerce website using rails 5 and activeadmin gem to manage my dashboard. I have a product and a category model in a many to one relationship. class Product < ApplicationRecord ...
Andre Roy's user avatar
1 vote
0 answers
66 views

error adding a new field to active admin only in production

I created the migration to add two new fields to the database, run rake db: migrate, added the name of the fields in project.rb inside the admin folder. It works in development perfectly and even ...
jeff's user avatar
  • 377
1 vote
1 answer
2k views

Add link on edit form for activeadmin

I need to add a link/button in the middle of the form in ActiveAdmin. I try to add action for has_multiple fields but it doesn't work: form .. f.has_many :colors, sortable: :position, ...
Alex Kleshchevnikov's user avatar
0 votes
1 answer
71 views

Nested resource id mix-up in member_action

I have an action_item on a SupportSession resource 'show' page. Note that this particular resource is nested under SupportAllocation: ActiveAdmin.register SupportSession do belongs_to :...
Chris Kenworthy's user avatar
0 votes
2 answers
119 views

How to map one user to another (from same table)

I'd like to know how to solve this problem in my model/migrations, with correct referential integrity/uniqueness constraints. I have a user table with two types of user: support_worker and ...
Chris Kenworthy's user avatar
2 votes
1 answer
1k views

Custom action_item on show page only

I'm struggling to create an action_item for a show page (not the index) of a resource. I need to add a button on the show page, which when the user clicks it, updates a single attribute on the ...
Chris Kenworthy's user avatar
0 votes
1 answer
146 views

How to traverse associations

I'm finding it tricky to traverse associations in Active Admin. In my application I have a SupportSession which appears on an Invoice. Through an association with SupportAllocation I can traverse up ...
Chris Kenworthy's user avatar
0 votes
1 answer
178 views

ActiveAdmin on a per-resource basis

I'm feeling really stupid right now. I am using ActiveAdmin to control different things in my NGO: members, staff, donations and so on, each defined as an ActiveAdmin Resource (i.e. tab with different ...
Sprachprofi's user avatar
  • 1,259
1 vote
1 answer
3k views

Custom action_item with custom method in Active Admin

I have a nested resource in Active Admin which shows all SupportSessions (like meetings) for a particular SupportAllocation (which defines a teacher-pupil relationship): ActiveAdmin.register ...
Chris Kenworthy's user avatar
0 votes
1 answer
395 views

Active Admin returning error using ransack

I am trying add a custom filter in active admin which can filter status by name. Status is stored in Order table where 0 or 1 represent 'pending'. I am using ransacker to return filtered orders but it ...
Mohammad Ali's user avatar
0 votes
1 answer
495 views

Activeadmin assets loading in every non admin page

I am running in an issue setting up the activeadmin gem. It's running fine but the issue is that it's loading the assets required from activeadmin in my main layout view. I wonder how to make it ...
Thiago Augustus Oliveira's user avatar
2 votes
1 answer
586 views

Active Admin logout redirect loop

I've installed Active Admin, Devise and CanCan, plus configured the CanCan adapter (as per the instructions on Active Admin's wiki). The problem I have is that when the user logs out, the system doesn'...
Chris Kenworthy's user avatar
0 votes
1 answer
2k views

How can I write a form to input a list of text with ActiveAdmin?

I'm writing an ActiveAdmin form for a record which takes an Array of Strings. Let's call them widgets. I'm using a multi select form like so: ActiveAdmin.register Things do permit_params widgets[] ...
Schwern's user avatar
  • 164k
2 votes
1 answer
546 views

Google analytics with Rails 5 and ActiveAdmin

I've followed these steps and I successfully see traffic going to my site, the problem is I can see the traffic of every controller/method EXCEPT those within the admin namespace, because the script ...
Patricio S's user avatar
  • 2,120
0 votes
1 answer
806 views

Active admin addons :search_select_filter causes uninitialized constant error

Active admin addons select2 search plugin docs: https://github.com/platanus/activeadmin_addons/blob/master/docs/select2_search.md I've got: app/admin/users.rb ActiveAdmin.register User do filter :...
dezman's user avatar
  • 19.2k
0 votes
2 answers
298 views

ActiveAdmin logging out automatically after password change

The title says it all, basically I'm facing the same problem as here, but I'm using ActiveAdmin and I can't fix this problem. I've tried adding: controller do def update if current_account....
Patricio S's user avatar
  • 2,120
0 votes
1 answer
105 views

Tabs' contents fails to hide at the beginning

I will try to explain this problem so that it is understood perfectly for everyone. The thing is I'm displaying data and charts separated into several tabs using this syntaxis. In other words <...
Patricio S's user avatar
  • 2,120
0 votes
0 answers
177 views

Customizing the Comments' Index and Show Pages in ActiveAdmin

I want to be able to edit the Comments' Index and Show Pages in ActiveAdmin. By default the Index Page shows 6 attributes: resource_type, author_type, resource, author, body and created_at. But I want ...
Patricio S's user avatar
  • 2,120
1 vote
1 answer
2k views

Active Admin: add admin user works local but not in production

I have Ruby on Rails 5.2 API app with modifications so that active admin will work on the app. I try to add more admin users in the Admin User resource (in the app itself). When I run the server ...
Ofir Sasson's user avatar
4 votes
4 answers
4k views

ActionController::InvalidAuthenticityToken in ActiveAdmin::Devise::SessionsController#create

I'm using Ruby on Rails 5 Api app with modification to enable Active Admin. Everything was fine until now. I don't remember doing any changes in the app, but now, if I delete cookies and etc on the ...
Ofir Sasson's user avatar
0 votes
1 answer
914 views

how to correctly add jquery in activeadmin with api only mode and no application.js

When trying to make a custom page in active_admin in a rails api-only app, I get the following: $ is not defined I moved jquery.js into my /assets folder and imported it in my active_admin.js....
Ayrad's user avatar
  • 4,056
3 votes
1 answer
1k views

Set the title of Custom Pages in ActiveAdmin

I've looking for info about how can I modify the title of an ActiveAdmin Custom page, but nothing works. The solution I found only works for standard ActiveAdmin pages. For example, my Report page ...
Patricio S's user avatar
  • 2,120
0 votes
1 answer
672 views

How can I use parameters in the ActiveAdmin's dashboard?

I'm showing a lot of graphs and aggregated data in the ActiveAdmin's dashboard, but I would like to make it more flexible for the user, so after a lot of work I made a form in the dashboard using a ...
Patricio S's user avatar
  • 2,120
1 vote
1 answer
1k views

Active Admin with Rails API [closed]

A friend of mine and I are building an app from the scratch and both of us are in doubt of using the Active Admin gem, which is awesome and we would like to use. Our app is built on react and an api ...
Leonardo Momente's user avatar
0 votes
1 answer
257 views

Rails 5: include unrelated class inside active admin's resource

I have Rails 5 API app with active admin that's working fine. I created a class in lib which calls app_languages.rb and contains array of hashes for language properties. I want to share the data in my ...
Ofir Sasson's user avatar
2 votes
2 answers
693 views

ActiveAdmin Collection Names

I have an array of roles in my model: ROLES = ['super_admin', 'user', 'user_admin'] I have an ActiveAdmin form that shows these roles: input :roles, as: :check_boxes, collection: User::ROLES I ...
hashrocket's user avatar
  • 2,222
0 votes
0 answers
2k views

How can I insert or store multiple ids in a single column in Rails?

How can I insert or save multiple ids as comma separated e.g (2,5,8,10) values in single column in database for many to many relationship? I am using active admin for resource management.
Sudeep Ghimiray's user avatar
3 votes
1 answer
2k views

How to add image upload fields to active_admin with active storage

I have an Event Model which as many images fields class Event < ApplicationRecord has_one_attached :poster has_one_attached :ticket_image has_many_attached :images end How can I create and ...
foliwe83's user avatar
  • 580
0 votes
1 answer
460 views

ActiveAdmin error 401 Can no longer log in with working credentials. Using rails 5.2

I created an ActiveAdmin user and I can no longer log on using any of my previous ActiveAdmin users nor can I create a new one. When I try, I get a 401 error. I have tried multiple times to manipulate ...
Hodari Toure''s user avatar
1 vote
1 answer
385 views

Rails 5.2.1: File input being replaced by text inputs - ActiveAdmin nested attributes form

How can I stop my file input field being replaced by my text input fields? Versions: Rails 5.2.1 ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] rvm 1.29.4 I am using an ...
sparkhead95's user avatar
-1 votes
1 answer
112 views

How to display multiple attributes items of a model in list item in rails active admin index page?

In a model which has multiple attributes comes from a many to many relationship is shown with comma separated in active admin index page. index do # other columns goes here column('Product ...
Sudeep Ghimiray's user avatar
1 vote
5 answers
998 views

Can't use cont_any for multiterm search with Ransack (Rails 5)?

I'm using Ransack for search, which is working fine. But I would like the user to be able to search for multiple keywords in the same search input field. For example if I have blog "I live in Ohio", ...
userden's user avatar
  • 1,673
0 votes
1 answer
89 views

Can not show multiple attributes (nested items) in Rails Active Admin Index page

I have two models product and product_category A product contains or mapped with multiple product categories and vice versa. It is maintained through many to many relationships for which there is ...
Sudeep Ghimiray's user avatar
1 vote
0 answers
2k views

Rails 5 Active Admin use JQuery to show/hide field in form after dropdown selected

EDIT: I used Leo answer and edited the code a little, update code below I have course model which has many segments. Segment is Video or Quiz, and Quiz has many questions. I have form which contain ...
Ofir Sasson's user avatar
0 votes
1 answer
378 views

Rails ActiveAdmin Profile(User)

This may be something simple but I need a clarity please. I already have Active rails MODEL Profile(representing Users) so devise is already using the MODEL Profile I know active admin integrates ...
Charlie's user avatar
  • 246
0 votes
1 answer
994 views

Active Admin form: has_many inputs in separate panels by condition

I am trying to use active admin and formtastic to create a form where reviews of a specific type is edited on a separate panel, currently I render the panels through a .html.erb partial like this: &...
User9123's user avatar