activeadmin

how do add a link to an ActiveAdmin view

▼魔方 西西 提交于 2019-12-18 12:25:17
问题 I have: ActiveAdmin.register User do show :title => :name do attributes_table do row :username row :email row :last_request_at row :foo end end end and I want foo just make a <a href="/foo">foo</a> in the view. So I define: def foo <a href="/foo">foo</a> end in the user.rb model. And it displays but the tag is escaped so it's not clickable. Is there a simple way to do this? 回答1: You can try: row :foo do link_to('foo','#') end and replace '#' with your route. 回答2: if you are working with a has

Active Admin - refresh second drop down based on first drop down, Ruby on Rails

若如初见. 提交于 2019-12-17 23:07:53
问题 I am using Active Admin Gem on Ruby on Rails. I have a form in which i have selected category and sub category and then accordingly i have to fill the data. So i created two tables in sqlite added in active admin resouce. Every thing is working fine but the drop down of sub category is not getting filtered based on the category choosen. I am new to Ruby and RoR too. I don't know how to refresh dropdown of the subcategory after selecting category. I know i can do it from AJAX and javascript

How to use ActiveAdmin on models using has_many through association?

不打扰是莪最后的温柔 提交于 2019-12-17 22:29:09
问题 I am using ActiveAdmin gem in my project. I have 2 models using has_many through association. The database schema looks exactly the same as the example in RailsGuide. http://guides.rubyonrails.org/association_basics.html#the-has_many-through-association (source: rubyonrails.org) How can I use ActiveAdmin to ... show appointment date of each patient in physicians page? edit appointment date of each patient in physicians page? Thanks all. :) 回答1: For 1) show do panel "Patients" do table_for

Rails Admin vs. ActiveAdmin [closed]

爷,独闯天下 提交于 2019-12-17 17:27:31
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I've been looking into some rails admin plugins and came across these: https://github.com/gregbell/active_admin https://github.com

Active admin install with Rails 4

浪尽此生 提交于 2019-12-17 07:01:26
问题 I got this error when installing active admin on Rails 4 Bundler could not find compatible versions for gem "actionpack": In Gemfile: meta_search (>= 1.1.0.pre) ruby depends on actionpack (~> 3.1.0.alpha) ruby rails (= 4.0.0.rc1) ruby depends on actionpack (4.0.0.rc1) I follow this instruction: http://www.activeadmin.info/docs/documentation.html Anyone help please. 回答1: Apr 20, 2015 update For Rails 4 (according to the official github page) use either master: gem 'activeadmin', github:

RuntimeErrorenvironment Circular dependency detected while autoloading constant User + Rails

泄露秘密 提交于 2019-12-14 03:22:42
问题 After removing active_admin i am getting this error from production. Please help me how do i solved this error. app/admin/user.rb:1<top (required)> ActiveAdmin.register User do # See permitted parameters documentation: # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters # # permit_params :list, :of, :attributes, :on, :model 回答1: If you remove the activeadmin gem, you need to delete all files from app/admin and one line from

ActiveAdmin + Jquery-ui-rails 5.0.0 gem

别等时光非礼了梦想. 提交于 2019-12-14 02:30:00
问题 I'm trying to use active admin gem but when i ran bundle it says i need jquery-ui-rails version 5.0.0 so i changed my gemfile to : gem 'jquery-rails' gem 'jquery-ui-rails', '~> 5.0.0' gem 'activeadmin', github: 'gregbell/active_admin' Upon restart my server i'm getting this error in the browser File to import not found or unreadable: jquery.ui.all. Load paths: /.../.../.../.../app/assets/images /.../.../.../.../app/assets/javascripts /.../.../.../.../app/assets/stylesheets 回答1: jquery-ui

scoping with active admin cancan

安稳与你 提交于 2019-12-14 00:34:13
问题 How can i use scoping with active admin & cancan. I have admin users & those have (has_one) relation with institution and institution has many profiles Now when admin user login then i want display all profiles which has same institution. Doesn't find following link much helpful. http://activeadmin.info/docs/2-resource-customization.html#scoping_the_queries 回答1: if you just do simply this, do you get a problem? # ability.db def initialize(user) case # ... when user.super_admin? can :manage,

How can I override “after_sign_up_path_for” in ActiveAdmin?

点点圈 提交于 2019-12-13 19:17:51
问题 I am building a Rails application (using ActiveAdmin and Devise ) and I am trying to override the after_sign_up_path_for to change the redirection after signing up. I followed this tutorial from devise but my RegistrationsController is never called. I guess it might work a little bit differently with ActiveAdmin. I also tried other solution I found on stack overflow without any luck. Here is my routes : Rails.application.routes.draw do devise_config = ActiveAdmin::Devise.config devise_config[

Select2-rails is not working with ActiveAdmin

岁酱吖の 提交于 2019-12-13 18:09:55
问题 I have difficulties integrating select2-rails with ActiveAdmin. I followed setup steps on Select2-rails Github page: https://github.com/argerim/select2-rails and I added line: //= require select2 to app/assets/javascripts/application.js and line: *= require select2 to app/assets/stylesheets/application.css so I assume when I have page in ActiveAdmin I should be able to add line: $('#add_student_select').select2() to active_admin.js.coffee But its not working. In console I can see following