activeadmin

How to define custom Failure for devise in case of two different models User and active admin?

随声附和 提交于 2020-08-22 05:38:36
问题 I have two models User and ActiveAdmin on which I want to apply my devise integrations. I have my custom_failure.rb as follows class CustomFailure < Devise::FailureApp def redirect_url login_path end # def redirect_url # root_path # end def respond if http_auth? http_auth else redirect end end end Which seems to be working great. Also, can define in my application controller like : def after_sign_in_path_for(resource) # case resource if resource.is_a?(Admin) admin_dashboard_path else root

Sort a table_for in rails activeadmin

纵然是瞬间 提交于 2020-08-02 06:23:41
问题 In an active admin show page, I've got two panels, the first being the primary record, the second being associated info (by has_many) so show looks like this: panel "Max Amount" do table_for user.max_amount do column 'Amount', :amount column 'time', :updated_at end end Can i sort this high-to-low (or low-to-high) on the amount column? Update: I found the source for the demo ( https://github.com/gregbell/demo.activeadmin.info/blob/master/app/admin/users.rb ) which seems to have sorting but

Active Admin - filter by presence of has_many association

寵の児 提交于 2020-07-08 11:18:56
问题 I have a User model that has_many photos. I'm looking to set up a checkbox filter in Active Admin to filter those users who have photos. Basically where the photos association is present. class User < ActiveRecord::Base has_many :photos end Is there an easy way to do this? I know you can filter by users who have a certain photo etc. but I haven't seen an example where you can filter by presence. 回答1: Finding the correct incantation of Ransack search methods is tricky. To search where the

Display has to many association activeadmin rails not working in staging but works fine in local and development

十年热恋 提交于 2020-06-29 10:36:33
问题 I have users which can have many identities, (depending on whether they login using facebook, google, or my site). In ActiveAdmin to display the identities I had the following code. ActiveAdmin.register User do menu label: 'Subscribers' ActiveAdmin.register Identity do belongs_to :user end index do selectable_column column :email column :current_sign_in_at column :sign_in_count column :created_at column "Sign-up Provider", :identities do |user| ul do user.identities.collect do |identity| li

Display has to many association activeadmin rails not working in staging but works fine in local and development

假装没事ソ 提交于 2020-06-29 10:36:27
问题 I have users which can have many identities, (depending on whether they login using facebook, google, or my site). In ActiveAdmin to display the identities I had the following code. ActiveAdmin.register User do menu label: 'Subscribers' ActiveAdmin.register Identity do belongs_to :user end index do selectable_column column :email column :current_sign_in_at column :sign_in_count column :created_at column "Sign-up Provider", :identities do |user| ul do user.identities.collect do |identity| li

action text with active admin not working properly

拈花ヽ惹草 提交于 2020-04-30 08:50:18
问题 I am using active admin and active text with rails 6 when I inserted image inside rich_text_area using active admin (f.rich_text_area) then it appears inside text area immediately but when I tried to save the same then in log file I found img tag is not included in parameter. so when I press edit button of article then no image appears. I have successfully install active_storage and active_text please find below details model/article.rb class Article < ApplicationRecord belongs_to :category

action text with active admin not working properly

自作多情 提交于 2020-04-30 08:48:55
问题 I am using active admin and active text with rails 6 when I inserted image inside rich_text_area using active admin (f.rich_text_area) then it appears inside text area immediately but when I tried to save the same then in log file I found img tag is not included in parameter. so when I press edit button of article then no image appears. I have successfully install active_storage and active_text please find below details model/article.rb class Article < ApplicationRecord belongs_to :category

action text with active admin not working properly

孤人 提交于 2020-04-30 08:48:19
问题 I am using active admin and active text with rails 6 when I inserted image inside rich_text_area using active admin (f.rich_text_area) then it appears inside text area immediately but when I tried to save the same then in log file I found img tag is not included in parameter. so when I press edit button of article then no image appears. I have successfully install active_storage and active_text please find below details model/article.rb class Article < ApplicationRecord belongs_to :category

action text with active admin not working properly

与世无争的帅哥 提交于 2020-04-30 08:48:18
问题 I am using active admin and active text with rails 6 when I inserted image inside rich_text_area using active admin (f.rich_text_area) then it appears inside text area immediately but when I tried to save the same then in log file I found img tag is not included in parameter. so when I press edit button of article then no image appears. I have successfully install active_storage and active_text please find below details model/article.rb class Article < ApplicationRecord belongs_to :category

while population sub category dropdown receive below error active admin

只愿长相守 提交于 2020-04-30 08:46:47
问题 Error:- ActionView::MissingTemplate (Missing template admin/blogs/get_child_category, active_admin/resource/get_child_category, active_admin/base/get_child_category, inherited_resources/base/get_child_category, application/get_child_category with {:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json,