activeadmin

Adding New Admins to Active Admin

狂风中的少年 提交于 2019-12-20 08:27:26
问题 I am using devise for my users. I recently installed the rails Active Admin gem, everything is working beautifully. However I can't figure out how to add a new admin users. I can see that active admin created an admin_user table in the db with a user admin@example.com, which I use to log in to the interface. I tried adding admin_user as a resource so that I can just click the Add Admin User button within the active admin interface to add a new user, however that does not seem to work. 回答1:

How to add button to ActiveAdmin's index page

允我心安 提交于 2019-12-19 15:15:46
问题 I created a collection action for ActiveAdmin rescource and want to link to it from the resource index page. But how do I customize the resource index page? The manual gives some options, but none to add html / buttons on the page (or I cannot see where). http://activeadmin.info/docs/3-index-pages.html 回答1: You can create buttons on index page with action_item block: action_item only: :index do link_to 'Button text', post_path(post) end https://github.com/activeadmin/activeadmin/blob/master

How to add button to ActiveAdmin's index page

烈酒焚心 提交于 2019-12-19 15:14:17
问题 I created a collection action for ActiveAdmin rescource and want to link to it from the resource index page. But how do I customize the resource index page? The manual gives some options, but none to add html / buttons on the page (or I cannot see where). http://activeadmin.info/docs/3-index-pages.html 回答1: You can create buttons on index page with action_item block: action_item only: :index do link_to 'Button text', post_path(post) end https://github.com/activeadmin/activeadmin/blob/master

rails activeadmin drop down menu on new and edit forms [duplicate]

时光怂恿深爱的人放手 提交于 2019-12-19 09:21:23
问题 This question already has answers here : Changing what attribute is displayed in drop down association filter in active admin with Rails 3.1 app (2 answers) Closed 5 years ago . I have a has_many belongs_to association. I registered the resource. I have shipments that belong to customers. But when I go to the new shipment form, in the drop down select menu for customers I get #<0X0000> Why? How can I fix it? I think it's because the Customers table doesn't have a "name" attribute, instead I

Activeadmin: how to filter for strings that match two or more search terms

你离开我真会死。 提交于 2019-12-19 06:04:48
问题 Let's say I've got User class with an :email field. And let's say I'm using activeadmin to manage Users. Making a filter that returns emails that match one string, e.g. "smith", is very simple. In admin/user.rb , I just include the line filter :email This gives me a filter widget that does the job. However, this filter doesn't let me search for the intersection of multiple terms. I can search for emails containing "smith", but not for emails containing both "smith" AND ".edu". Google tells me

Ruby On Rails Active Admin has_many changing dropdown to use a different column

試著忘記壹切 提交于 2019-12-19 04:02:16
问题 I am completely new to ActiveAdmin and RoR and i cant figure out how to change the visible value of the dropdowns in a has_many association. Fillup Model class Fillup < ActiveRecord::Base // key is car_id:integer belongs_to :car end Car Model class Car < ActiveRecord::Base validates :description, :presence => true key is fillup_id:integer has_many :fillups end What it currently shows: It currently shows im assuming an encoded reference to the Car assigned to it. What i need it to show: I need

Handling more than one admin types login with ActiveAdmin

给你一囗甜甜゛ 提交于 2019-12-19 03:19:14
问题 I have an application requiring three User types(User, Agent, Admin) with login and requiring different devise modules. User AgentAdmin AdminUser confirmable Yes Yes No lockable Yes Yes No timeoutable No Yes Yes Omniauthable Yes No No database_authenticatable Yes Yes Yes recoverable Yes Yes No rememberable Yes Yes No trackable Yes Yes Yes validatable Yes Yes Yes Further these users may have additional columns based on their type. So, I want to create different tables based on their type.

ActiveAdmin: How to handle large associations

徘徊边缘 提交于 2019-12-19 03:14:36
问题 I'm building an interface for administrating organizations that can have lots of people connected. The total pool of people consists of a few thousand individuals. To the best of my knowledge, AA doesn't really have a good system for this kind of situation. So far I've used something like this in the form block to add/remove people from the organization: f.has_many :person_organizations, for: [:person_organizations, f.object.person_organizations.active] do |connection_f| all_people = Person

Active Admin authentication conflicting with User authentication

烈酒焚心 提交于 2019-12-18 15:09:01
问题 Active Admin is a gem used for having an admin dashboard in your application. It uses Devise for logging in users and creates a separate admin_user model for the admins. My application already uses devise and has its users as the user model. Ever since I started using the active admin gem, in my routes file the following line keeps resolving to home#index and not users#dashboard even when my user is logged in. This used to work fine earlier where logged in users were taken to users#dashboard

Active Admin scopes for each instance of a related model

≡放荡痞女 提交于 2019-12-18 13:21:03
问题 I have an issue with a dynamic active admin scope. I am attempting to create a scope for each "manager" of a "project" in my app. However, the scopes don't seem to update when a new manager is created (or assigned to a project) but they DO update if I restart the server. So the code "works" per se but obviously not in the way I would like it to. I'm a ruby/rails noob so I am not sure if I need to do something to "refresh" the scope in some way. As an FYI, I am using Rails 3.2 on Heroku Cedar