activeadmin

while population sub category dropdown receive below error active admin

匆匆过客 提交于 2020-04-30 08:46:22
问题 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,

Active Admin login for admin users redirects back to the login page with correct credentials only in Chrome on localhost

不问归期 提交于 2020-04-07 08:02:25
问题 I am only having this problem locally in Chrome, not in production. It is also not a problem in Safari or Firefox. I am not sure what caused the problem as my only recent change was adding Redis/Sidekiq for asynchronously handling jobs, which doesn't seem relevant. I cleared my cookies in Chrome and it still did not help. The problem started after I reset the local database and loaded in my seeds and example data. I used psql to look at the data in the database and can confirm that I have the

How do you add a second column of 'children' without duplicating the 'parent' column entry in Active Admin?

霸气de小男生 提交于 2020-03-06 03:32:06
问题 This table, Raw Table with correct output, is the result I am looking for, but how do I translate this block of code into whatever Active Admin /app/admin/postal_code.rb index view requires to output the table correctly. Currently this block is rendered in a partial, /app/views/admin/postalcode/_showtable.html.erb <h1>Postal Code per Region</h1> <table> <tr> <th>Region</th> <th>Postal Code</th> </tr> <% @region.each do |region| %> <tr> <td><%= region.name %></td> <td> <table> <% list =

How do you add a second column of 'children' without duplicating the 'parent' column entry in Active Admin?

↘锁芯ラ 提交于 2020-03-06 03:31:46
问题 This table, Raw Table with correct output, is the result I am looking for, but how do I translate this block of code into whatever Active Admin /app/admin/postal_code.rb index view requires to output the table correctly. Currently this block is rendered in a partial, /app/views/admin/postalcode/_showtable.html.erb <h1>Postal Code per Region</h1> <table> <tr> <th>Region</th> <th>Postal Code</th> </tr> <% @region.each do |region| %> <tr> <td><%= region.name %></td> <td> <table> <% list =

Skip before filter with Active Admin

风格不统一 提交于 2020-01-29 10:38:04
问题 I am using devise and recently added active admin, which created a separate table of admin_users to keep admins. All works fine with Active Admin when I try to log in and browse around. However, my application controller has this for general users: before_filter :authenticate_user!, :except => [:show, :index] Because of this, when inside the active admin interface, whenever I try to edit or delete anything, it asks me to log in. I learned that a skip_before_filter can be used inside the

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

和自甴很熟 提交于 2020-01-25 11:18:45
问题 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. 回答1: The has_many :through Association A has_many :through association is often used to set up a many-to-many connection with another model. This association indicates that the declaring model can be matched with zero or more instances of another model by proceeding through a third model. For example,

ActiveAdmin: how to add second custom index table page

和自甴很熟 提交于 2020-01-23 17:04:08
问题 Users of some admin need to have two table views of, say, a model Bar : default one they already have and an additional new one with different set of columns. The setting is such: ActiveAdmin.register Bar do # … index do column :name column :phone column :address end # … It's expected to be as easy as adding another index block as in: ActiveAdmin.register Bar do # … index do column :name column :price column :bartender end index name: 'location' do column :name column :phone column :city

Active Admin date filter date format customisation

老子叫甜甜 提交于 2020-01-23 00:08:06
问题 Is there simple way to change the ActiveAdmin date filter display format from the default ISO format (yyyy-mm-dd)? 回答1: Instead of overwriting the js you can provide extra options to the datepicker like this: = f.input :my_date, as: :datepicker, datepicker_options: { dateFormat: "mm/dd/yy" } 回答2: The way i fixed is is like this: $ -> # reset format $('.datepicker:not(.hasDatepicker)').each -> if $(@).val().length > 0 p = $(@).val().split('-') $(@).val("#{p[2]}-#{p[1]}-#{p[0]}") # change

Show child/nested attributes in ActiveAdmin index view column

点点圈 提交于 2020-01-15 09:47:26
问题 I'm trying to show the value of a nested attribute in ActiveAdmin. My code is as follows: index do column :code column 'Sales Agent' do |client| client.sales_agent.agent_name end end This gives me: NoMethodError in Admin/client_branches#index Showing /Users/constantlm/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.4.3/app/views/active_admin/resource/index.html.arb where line #1 raised: undefined method `agent_name' for nil:NilClass I don't understand why this doesn't work, because when I do the

Installing Active Admin and getting an ArgumentError

我们两清 提交于 2020-01-15 03:33:16
问题 I'm trying to use ActiveAdmin for my first time w/ Rails 4. Upon installing all dependent gems, I try to run the installer, i.e.: rails generate active_admin:install Doing so gives me the following error: in `add_route': Invalid route name, already in use: 'admin_root' (ArgumentError) However, I don't have any 'admin_root' route in routes.rb so I'm a little confused. Here's the output from running 'rake routes': Prefix Verb URI Pattern Controller#Action exams GET /exams(.:format) exams#index