Questions tagged [activeadmin]

1

votes
1

answer
298

Views

How to add a custom column which is not present in table in active admin in rails?

in my rails application, i have installed active admin. in users index page, by default, all columns are getting displayed(User table columns). I want to add a custom column called 'become user' in this users index view (which is not a column in User's table). under this column i want to display use...
John
1

votes
1

answer
700

Views

rails activeadmin how to use action_item?

The poorly documentation saying: action_item :view, only: :show do link_to 'View on site', post_path(post) if post.published? end But it's not saying where 'post' in post_path(post) coming from. I guess in this example they are adding a 'view' custom action that will execute the view member_action i...
Ziv Barber
1

votes
1

answer
632

Views

Overriding active admin session controller

I need to add two factor authentication for active admin. Whenever admin tries to login I need to verify them before giving access. Verification can be done either by sending OTP to email or mobile. So I need to over ride the Sessions controller for active admin devise so that I can add the function...
pawan kumar
1

votes
1

answer
241

Views

upload and show multiple images in cloudinary using carrierwave

I have a form field as below through which I can add multiple images at once. I am uploading image in admin panel which uses active-admin gem. form(html: { multipart: true }) do |f| f.inputs do f.input :title f.file_field :photos, multiple: true end f.actions end I want to be able to add multiple im...
CCR
1

votes
0

answer
17

Views

Active Admin plugin for Rails5 bug

So I have a rails page that's being controlled by a controller: def update(options={}, &block) {....... super } and 'wrong number of arguments (given 2, expected 1)' is returned when super call gets executed. This never happened in Rail4. Any clues?
Kayci Wang
1

votes
1

answer
248

Views

Custom ActiveAdmin Filter for Date Range - Complex Logic in Method

I am trying to create a custom ActiveAdmin filter that takes date_range as a parameter. Every solution I've found has been for excessively simple model methods. Is there a way to pass both parameters into the model ransacker method, and/or at the very least to control the order in which these param...
Emilia Flo
1

votes
1

answer
48

Views

ActiveAdmin model with has_many relationship - custom form button to “Add All” possible resources

Example models: class Person has_many :auto_mappings, dependent: :destroy class Vehicle has_many :auto_mappings class AutoMapping belongs_to :person belongs_to :vehicle validates :person, :vehicle, :usage, presence: true In my ActiveAdmin form for Create/Edit on Person, I include an input f.has_m...
AJ.
1

votes
0

answer
34

Views

Error with rails and active admin filter, when filter 'in' is empty

how are you? I have a problem with ActiveAdmin, I have a view where I have filterts to search specific records. Like this filters: filter :has_open_offers_in, as: :select, label: 'Has buyer offers?', collection: ['Yes', 'No'] filter :expiring_tonight_in, as: :select, label: 'Expires tonight?', colle...
facundo espinosa
1

votes
2

answer
182

Views

ActiveAdmin translation_missing in login page

In active admin I am using corp_id instead of email for Admin User to login their account. But in login page I am getting incorrect label name as Title instead of corp_id.I tried to change that label using CSS but it doesn't work for me. How to change the label name of Title to Corp-ID Please let me...
Sethu Karthik
1

votes
2

answer
561

Views

Active Admin Show Page for one model is not working

I am integrating Active Admin into a Ruby on Rails app. I registered all my models and already set up index, filter and show for all the models. Everything is working, but for one model the admin/show page is not running. When calling the show page from the admin/index page, I get: NoMethodError in...
SEJU
1

votes
0

answer
108

Views

How to create/handle a custom string filter on active admin outside of my model scope

I use ransack to handle basic custom filter but I don't know how to handle a active admin string filter that has options like (Contains, Equals, Starts with, Ends with). this is what I've done so far but it results to an error when hitting the filter button. Error: PG::UndefinedFunction: ERROR: ope...
Jedidiah
1

votes
2

answer
73

Views

Sendgrid for ActiveAdmin

I have a website that currently sends an email to users once they sign up using sendgrid. This works all and well, but I cannot figure out how to do this: When to user makes a reservation on my website(its kind of like open table), the reservation object is created. I then can go on Active Admin and...
Albert Jin
1

votes
1

answer
236

Views

How to test ActiveAdmin?

I'm using ActiveAdmin on my rails project, and I would like to know how test it, like how does activeadmin usually test? Since there's no tutorial on the internet, is it necessary to test it?, like this answer I found https://softwareengineering.stackexchange.com/questions/256557/should-i-be-writing...
gilbertlcsndle
1

votes
1

answer
58

Views

Redirect issue with admin login using ActiveAdmin in rails app

I'm using devise and activeadmin. When I log in to my app as an Admin (http://localhost:3000/users/admin) the app redirects me to to the http://localhost:3000/users/sign_in page. So basically I have to login at some user to be able to log in as Admin. Which is really inconvenient. this is my applica...
Slowboy
1

votes
0

answer
71

Views

Active Admin and lightbox

I have a problem with lightbox, when I set the attribute data-lightbox, no info is displayed in the tag, just have href attribute index do selectable_column id_column column :validate_by_us column :resource column 'Photo' do |photo| link_to image_tag(photo.photo_url), image_path(photo.photo_url), :d...
H.Akca
1

votes
1

answer
100

Views

Ruby on rails - activeadmin - batch_action default text

is there a way to set a default input value for batch_actions? e.g. I have 3 inputs fields, I want to save these in a session, but I couldn't figure out, how to set a default text in my form. form -> { 'Bla' :text } ... do you guys know how I can set a default value? Thanks in advance for your help.
SmackerJacker
1

votes
1

answer
32

Views

gem rich don't apperas in Active_admin

I installed gem rich in my Rails 4.1.5 project. I'm using Active Admin. In my file of admin I have this line that calls rich: f.input :content, :as => :rich, :config => { :height => '200px' }, :label => 'Conteúdo' But when I open Active_admin, the rich don't appears (should appear right below the f...
Felipe Marcon
1

votes
4

answer
246

Views

undefined method beginning_of_day for string with ransacker custom filter

I'm getting below mentioned error. any idea how i can fix it ? undefined method `beginning_of_day' for '2018-01-01':String /lib/ransack_ext.rb config.add_predicate old, arel_predicate: current end config.add_predicate 'gteq_datetime', arel_predicate: 'gteq', formatter: ->(v) { v.beginning_of_day } C...
kashif
1

votes
0

answer
66

Views

Activeadmin - Associated model name with field name returning “uninitialized constant”

I am using activeadmin - 1.2.1, activeadmin_addons - 1.1.2 and rails 5.1. I want to filter based on associated model field name so I have written a filter: filter :customer_client_id, as: :search_select_filter, url: proc { customer_index_path }, fields: %i[key name], display_name: 'name', minimum_in...
Anson GN
1

votes
0

answer
94

Views

Error : double nested forms in active admin with habtm

ActionView::Template::Error (undefined method `events' for # Did you mean? eventusers): 1: insert_tag renderer_for(:new) app/admin/programs.rb:23:in block (5 levels) in ' app/admin/programs.rb:22:inblock (4 levels) in ' app/admin/programs.rb:21:in block (3 levels) in ' app/admin/programs.rb:17:inbl...
Ganesh Raju
1

votes
0

answer
28

Views

How can I disable the Formtastic when I make a form on activeadmin?

I have decimal columns, and since by default, Formtastic doesn't support decimal numbers, I want to disable it in certain controllers, Even though I've been looking for the info, I hardly found it so please help me. No code, since Formtastic just doesn't support decimal numbers.
西田龍
1

votes
1

answer
129

Views

Ruby on Rails : Background CSS Image from Database

I want to create a picture management through my ActiveAdmin administration panel. I use Carrierwave to upload images from my administration panel, however I fail to display these images as background-image within my CSS code... :/ ...because of the following error: couldn't find file '' Here is my...
1

votes
1

answer
115

Views

ActiveAdmin/Httparty: Can I access json response from variable in view?

I'm using an ActiveAdmin custom page and httparty to request a json response from a third-party api. I've successfully accessed the json data response, parsed it, set it to a variable, and used puts to see it in my console. How can I access this variable to view it on an activeadmin page? Here's my...
Daniel Berryman
1

votes
0

answer
80

Views

Reducing line count of calls to ActiveAdmin.register by using helper methods

I want to reduce the line count of my calls to ActiveAdmin.register by using semantically-relevant helper methods in order to improve readability. Overall, I'm less interested in testability and more focused on SRP. Effectively, what I'm trying to accomplish is this: ActiveAdmin.register User do in...
circles
1

votes
1

answer
171

Views

Active Admin filters not working

I'm struggling with filters on the index view of my ActiveAdmin resource. This is the abbrieviated source: ActiveAdmin.register PendingCollege do config.clear_action_items! controller do include Sendable end filter :name menu :parent => 'College' actions :all, :except => [:destroy, :edit] scope :all...
jaydel
1

votes
0

answer
32

Views

ActiveAdmin and Dynamic Rails namespace

The administrative panel manages employees of organizations. Now each organization has its own subdomain: dms.site.com/admin fake.site.com/admin But I want to use rails namespaces without subdomains: scope '/*business' do devise_for :users, ActiveAdmin::Devise.config ActiveAdmin.routes(self) end And...
1

votes
0

answer
36

Views

Active Admin namespace configuration conflicts

I am working with my clients existing active admin installation and trying to add an additional user group using namespaces. I have followed this post: https://stackoverflow.com/questions/19399030/handling-more-than-one-admin-types-login-with-activeadmin#= I am unfortunately getting some strange beh...
Darrell Lewis
1

votes
1

answer
56

Views

ActiveAdmin sort by nested association

I am having trouble sorting by an association of an association. I have a Student, who is in a School, which is in a City. I want to be able to sort users alphabetically by city name. class Student < ApplicationRecord ... belongs_to :school and class School < ApplicationRecord ... belongs_to :city...
mungojerie
1

votes
0

answer
79

Views

How to attach an image to an object with ActiveStorage in a rake task?

I'm using ActiveAdmin and ActiveStorage to manage the Card objects in my app. When going through the ActiveAdmin interface to create a new card with all its properties, including the image, it works fine. But when I try to use a rake task to seed the database with hundreds of cards, it fails and I g...
liamslagle
1

votes
1

answer
92

Views

How to get Active Admin to store a hash of Boolean key/values in a serialized object?

I used to have all my models accolades stored as boolean columns, and I'm trying to make it a bit cleaner and more manageable. This will only be edited by admins, It's only user-facing for display purposes. I'd like this to be a list of checkboxes, but I'm having trouble updating them from ActiveAdm...
James.Oliver
1

votes
1

answer
42

Views

Activeadmin custom filter fails

In activeadmin, we need to apply a kind of complicated filter on the index page of our Score model. Namely, we want to get the results in the Score table such that their ExportOrders have the selected DistributionChain. We start from the following models: class Score < ApplicationRecord has_and_belo...
Simon
1

votes
1

answer
39

Views

I want to update my user list on submitting the club form which automatically creates a club admin which in turn is a user in activeadmin

My dashboard.rb is: ActiveAdmin.register_page 'Dashboard' do menu priority: 1, label: proc{ I18n.t('active_admin.dashboard') } content title: proc{ I18n.t('active_admin.dashboard') } do # form render 'form' # Here is an example of a simple dashboard with columns and panels. columns do column class:...
Pujan Soni
1

votes
0

answer
22

Views

how to generate the logs for the activeadmin resources?

logging.rb require 'logging' activeadmin = Logging.logger['RootLogger::ActiveAdmin'] activeadmin.add_appenders( Logging.appenders.stdout, Logging.appenders.file('active_admin.log') ) activeadmin.additive = true, activeadmin.level = 'fatal' I want to seperatley generate activeadmin resources sepert...
Sanket Veer
1

votes
1

answer
39

Views

Ruby on Rails will not register active_admin upon server startup (http://localhost:3001/admin)

I am currently creating my first React-on-Rails project. I have an issue with loading the server when trying to run the RoR api. Application.rb require_relative 'boot' require 'rails' # Pick the frameworks you want: require 'active_model/railtie' require 'active_job/railtie' require 'active_record/...
1

votes
1

answer
809

Views

Active Admin not works, SASS error can't convert Sass::Rails::Importer into String

I install and configure 'Active Admin' to my rails app. It works fine on two of my computers, but not work at my production server. I have this error both in production and development (FreeBSD server): Started GET '/admin/login' for 192.168.0.1 at Wed Oct 26 22:12:53 +0300 2011 Processing by Active...
prosto.vint
1

votes
1

answer
2.3k

Views

How to customize Active Admin layout [closed]

A project I'm working on requires heavy customization of the layout of ActiveAdmin gem. Following this answer, I have copied the folder: lib/active_admin/views of the activeadmin gem into: app/admin folder of my application. At http://localhost:3000/admin I get all kinds of errors. For example:...
Panagiotis Panagi
1

votes
1

answer
2k

Views

Can't get skip_before_filter to work with ActiveAdmin in Rails

I am using the devise gem for authentication and have the following before_filter in my ApplicationController: before_filter :require_login def require_login unless user_signed_in? || params[:controller] == 'devise/sessions' flash[:error] = 'You must be logged in to access that page.' redirect_to ne...
John
1

votes
1

answer
1.3k

Views

View show page for menu item in Active Admin

I would like to dynamically change the menu based on the permissions of the viewing user. I would like the superadmin user to have access to the normal Resource actions (index, show, update, etc). So when an admin clicks on a menu item, it would take them to the index of that resource. I would like...
rabidpraxis
1

votes
2

answer
799

Views

Formtastic Gems input check_boxes didn't support checked/selected list

Am using formtastics in Active Admin gem Everything is working find except one thing that am passing it list to be checked/selected on check boxes list but not working.. So kindly help me in this regard. Thanks.. I tried this in Simple form Its working fine over there but not in Formtastic. false,...
Syed Raza
1

votes
1

answer
280

Views

docs on SPAN tag on rails, or is this something specific to activeadmin?

Those of you familar with activeadmin, you can do something like this in your admin controllers span 'Some Title' :class =>'edit_parent_category_link' do (code here) end If you try putting html in place for 'Some Title', it just prints it with the tags and dont render the html. Where can I get more...
SJonRails

View additional questions