Code Monkey home page Code Monkey logo

activeadmin's Introduction

Active Admin

Active Admin is a Ruby on Rails framework for creating elegant backends for website administration.

Version Github Actions Coverage Tidelift

Goals

  • Enable developers to quickly create good-looking administration interfaces.
  • Build a DSL for developers and an interface for businesses.
  • Ensure that developers can easily customize every nook and cranny.

Getting started

For enterprise

Active Admin for enterprise is available via the Tidelift subscription. Learn More.

Want to contribute?

If you want to contribute through code or documentation, the Contributing guide is the best place to start. If you have questions, feel free to ask.

Want to support us?

If you want to support us financially, you can help fund the project through a Tidelift subscription. By buying a Tidelift subscription you make sure your whole dependency stack is properly maintained, while also getting a comprehensive view of outdated dependencies, new releases, security alerts, and licensing compatibility issues.

You can also support us with a weekly tip via Liberapay.

Finally, we have an Open Collective where you can become a backer or sponsor for the project, and also submit expenses to it.

Dependencies

We try not to reinvent the wheel, so Active Admin is built with other open source projects:

Security contact information

Please use the Tidelift security contact to report a security vulnerability. Tidelift will coordinate the fix and disclosure.

Acknowledgements

Thanks to Greg Bell for creating and sharing this project with the open source community.

Thanks to all the people that ever contributed through code or other means such as bug reports, issue triaging, feature suggestions, code snippet tips, Slack discussions and so on.

Thanks to Tidelift and all our Tidelift subscribers.

Thanks to Open Collective and all our Open Collective contributors.

activeadmin's People

Contributors

amiel avatar brennovich avatar ccallebs avatar deivid-rodriguez avatar dependabot-preview[bot] avatar dependabot[bot] avatar fabiokr avatar faucct avatar felixbuenemann avatar fivell avatar gregbell avatar jancel avatar javierjulio avatar jeremyruppel avatar macfanatic avatar mattvague avatar mergify[bot] avatar mgrunberg avatar parndt avatar pcreux avatar rogerkk avatar samvincent avatar seanlinsley avatar sgara avatar shekibobo avatar tagliala avatar timoschilling avatar tinynumbers avatar varyonic avatar zorab47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activeadmin's Issues

Resource Collection display name

As a sweet programmer
I want to be able to change the Resource Collection display name, in case I have a crazy long name and I want to make it shorter in the views.
So that I dont have to overwrite Index.html.haml or Show.html.haml just to change the Collection name

Unable to create views for "Comment" model

I suppose it is because active_admin itself uses a Comment model but I am unable to create an admin view for Comment.

Using the following code:

ActiveAdmin.register Comment do

end

Produces the following error:

ActiveAdmin::ResourceMismatchError
Tried to register Comment as Comment but already registered to Comment

Modifying the show page - Am I misunderstanding Arbre?

Hey Greg,

When I wrote the quick wiki guide to setting up an admin interface for creating admins, I ended by saying that the show page was left as an exercise to the reader. Truth is, I didn't do it for my own admin interface, I didn't need it.

But now I'm trying to customize a show page for the first time, and it's not working for me. Even the example on the main documentation page doesn't seem to work when adapted to my model.

I have a Video model that has 2 attributes worth mentioning here: title and takeaways.

So based on the example in the doc:

ActiveAdmin.register Post do
  show do 
    h3 post.title
    div do
      simple_format post.body
    end
  end
end

I would have expected something like the following to work:

show do
  h3 video.title
  div do
    video.takeaways
  end
end

But it fails with

undefined method `takeaways' for #<Arbre::HTML::Video:0x10502bdd0>

As Brett Favre would say: what should I do?

Or more specifically, how should I access the attributes of my model? And would this approach also let me call the instance methods on that model (e.g. takeaways_html which converts the textile and marks it as html_safe).

I'd love to see an example of a show page that's working for you. What I actually wanted to do was rewrite the show page pretty much as it is, but with the fields in a different order and the "takeaways" text block as a pre or as rendered textile.

Thanks again for active_admin! I've been waiting for a long time for an admin interface that I loved, and it looks like I've found it :-)

Mat

Comments should work with models with String Ids

Edit: Original title: "Form for tables with string id's throw an exception"

PGError: ERROR: invalid input syntax for integer: "xksS5NjE"
LINE 1: ...admin' AND ("active_admin_comments".resource_id = 'xksS5NjE'..."

Looks like the comments tables expect integer ids on the parent table but this isn't universally true.

Change Resource display name

As a programmer
I want to be able to set the default display name for a resource so its says "John's Tires" instead of "Company #3" in both Index and Show pages
So that I dont have to overwrite views just to make a small name change

ActiveAdmin.default_sort_order "id_desc" prevents use of scopes with joins

Hi,

I'm using a model with some scopes involving joins. For example:

class User < ActiveRecord::Base
...
  def self.popular
    joins('LEFT JOIN followings ON users.id = followings.followee_id').
    group('users.id').
    where('COUNT(users.id) > 10')
  end
...
end

If I add this scope to my ActiveAdmin config, I get the following error when viewing the Users index:

Mysql2::Error: Column 'id' in order clause is ambiguous: SELECT COUNT(*) AS count_all, users.id AS users_id FROM `users` LEFT JOIN followings ON users.id = followings.followee_id GROUP BY users.id WHERE COUNT(users.id) > 10 ORDER BY id desc

This appears to be because in lib/active_admin.rb the default sort order is set to "id_desc", which doesn't then get scoped with the appropriate table name - hence the ambiguous query error.

There's a gist here with the full stack trace in case it's useful...

Cheers,
Simon

p.s. thanks for a wonderful tool, by the way - I'm really loving what I've seen of it so far.

Error rendering Edit for Polymorphic belongs_to

I installed the latest version (0.2.1) and i'm getting the following error when trying to render the Edit form of a model that has a polymorphic belongs_to association:

ActionView::Template::Error (uninitialized constant Deal::Creator):
    1: render renderer_for(:edit)

My model looks like this:

class Deal < ActiveRecord::Base
  belongs_to :creator, :polymorphic => true
end

Any idea? Thanks!

Configuration Options?

I've been using Active Admin for a few days now and I am really liking it so far. Thank you for your work.

Does a list of configuration options exist anywhere? Maybe a hash containing defaults? Just something I can browse over. It doesn't need full explanations/documentation, I just want to see what can be used.

I am noticing a lot of the DSL commands take a hash of options, but I've got no idea what I can pass in here. I've followed the calls through the code and was able to pickup some of the keys that get used later on, but I would like to see a list of everything I can pass in. Specifically for ActiveAdmin.register and then maybe the DSL::menu. I am sure a lot of other methods accept options as well.

Specifically, here some some questions I've had.

Can I change the name that gets displayed on the menu? I found the :as => "new name" option, but that seems to rewrite my routes as well.

Where exactly do things like priority/etc get set? and...

Where exactly is the best place to set everything thats used in config. Sometimes I define things with ActiveAdmin.register, other times it with menu(options hash)?

render show doesn't look in app/admin/[resource]

the documentation tells :

 ActiveAdmin.register Post do
    show do 
      # renders app/admin/posts/_some_partial.html.erb
      render "some_partial"
    end
  end

But when i added a _notation.html.erb in app/admin/sessions/ i had an error :

Missing partial admin/sessions/notation with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :arb, :haml], :formats=>[:html], :locale=>[:en, :en]} in view paths "/Users/loic/Documents/pro/projetB3/app/views", "/Users/loic/.rvm/gems/ruby-1.9.2-p136/gems/devise-1.3.4/app/views", "/Users/loic/.rvm/gems/ruby-1.9.2-p136/gems/activeadmin-0.2.1/lib/active_admin/views/templates", "/Users/loic/.rvm/gems/ruby-1.9.2-p136/gems/inherited_views-0.0.2/lib/inherited_views/default_views"

well by moving my sessions folder to app/views/admin/ it worked

i18n - column names and translating ActiveAdmin

Using the method t('path_inside_yml_file') doesn't work in column's names. It returns the path_inside_yml_file in the forms instead of the actual translated value.

Is it possible to translate the whole activeAdmin gem with yml files? I could give a hand here and share the results. Thanks.

Overriding Default ResourceController

Is it possible to override the default resource controller? I am looking to render a page tree (via awesome_nested_set), and am running into some difficulty specifying an action that will allow me to create a new Page instance that is a child of another page.

attributes_table cells overflow if too long and unbroken

The css for attributes_table allows for text to overflow. For example, in the demo, when you show a customer, the customer details if long enough and do not break (e.g. an email address) will overflow outside the sidebar.

Image: http://i.imgur.com/wzHEr.png
Link: http://demo.activeadmin.info/admin/customers/617

Can fix with something like:

.sidebar_section .attributes_table {
  width: 240px;
  overflow: hidden;
}

I can submit a patch later if that's desired, but I'm not very familiar with SASS.

using ActiveResource::Base inherited classes as models

Hi, I would like to use an ActiveResource::Base inherited class (in my case Mailee::Message) as a model with ActiveAdmin. It would be awesome to know what is the "minimal API" I should implement in my model in order to work.

CSS for tables inside panels

When a table is added to a panel, the design clashes. They both have massive gradient headers which don't look good together.

Application Base URI not working in Active Admin

I'm running a Rails 3 app on Passenger and am having an issue with the links generated by Active Admin. They aren't taking the Base URI into account. I'm setting the RailsBaseUri config option for Passenger, so the main app works perfectly. But Active Admin appears to be ignoring that and writing it's URLs without the base path. If I add the base path to my URL manually everything works correctly, it's just a problem in how Active Admin is generating it's internal URLs.

Rails 3.1 ActionDispatch callbacks break ActiveAdmin.setup

In Rails 3.1 the callback chain is different and this crashes initialization.

/Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/callbacks.rb:413:in _run_prepare_callbacks': undefined local variable or methodactive_admin' for #<ActionDispatch::Reloader:0x105b2bb90 @app=nil> (NameError)
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/callbacks.rb:81:in send' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/callbacks.rb:81:inrun_callbacks'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/actionpack/lib/action_dispatch/middleware/reloader.rb:46:in prepare!' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/application/finisher.rb:41 from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/initializable.rb:25:ininstance_exec'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/initializable.rb:25:in run' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/initializable.rb:50:inrun_initializers'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/initializable.rb:49:in each' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/initializable.rb:49:inrun_initializers'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/application.rb:94:in initialize!' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/railtie/configurable.rb:28:insend'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/railtie/configurable.rb:28:in method_missing' from /Users/njero/Projects/Web/wantful/wantful/config/environment.rb:5 from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/dependencies.rb:237:inrequire'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/dependencies.rb:237:in require' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/dependencies.rb:223:inload_dependency'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/dependencies.rb:639:in new_constants_in' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/dependencies.rb:223:inload_dependency'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/activesupport/lib/active_support/dependencies.rb:237:in require' from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/application.rb:76:inrequire_environment!'
from /Users/njero/.rvm/gems/ree-1.8.7-2010.02@wantful/bundler/gems/rails-9971387a3b4c/railties/lib/rails/commands.rb:38
from script/rails:6:in `require'
from script/rails:6

Changing the code in setup to this works for Rails 3.1 (but haven't tried in Rails 3.0.x)

  # Dispatch request which gets triggered once in production
  # and on every require in development mode
  ActionDispatch::Callbacks.to_prepare do
    ActiveAdmin.unload!
    Rails.application.reload_routes!
  end

Administering a Comment model

Hello,

I have a model named "Comment". I would like to administer that model. I ran the following command:

$ rails generate active_admin:resource Comment
  create  app/admin/comments.rb

It created a comments.rb Then when I tried to load the app, I got the following error:

Tried to register Comment as Comment but already registered to Comment

I think it is conflicting with the existing Comment model that is bundled with Active Admin.

Nested forms

Hello! I am looking at ActiveAdmin as a candidate to be used in my next project, I like it a lot.

However in all the examples, the edit form only edits the attributes of the given model. Is it possible to somehow edit associated models like Contacts on Person page (contact belongs_to person)?

I have seen some support for this in Formtastic, but I have no idea if it is possible in ActiveAdmin - how to make "add contact" button on Person page etc...

Thanks in advance for the reply!
Jakub Cerny

Feature Request: Iconify interface for Index as a table

It would be nice to have the ability to use some of the iconify icons in columns in the "index as a table" layout. I could be wrong but it looks like there is only an interface to use them on headers for the dashboards and sidebar sections.

Something along the lines of:

index do
  column do |post|
    post.published? ? :icon => :check : :icon => :x
  end 
end

SASS Plugin Path is relative to CWD

This causes issues when the CWD is not the path that Rails.root is. To solve, we should ensure that the SASS path is Rails.root + public/stylesheets/admin.

Arbre, layouts

I like the idea of the Arbre DSL. What I'm not sure of yet is the benefit of completely departing from layouts.

It was a bit confusing a a time sync to figure out why changes to the layout file in the project weren't being rendered. Integrating other functionality within the same look and feel benefits from a shared layout. While I like the DSL syntax I'm wondering whether there's a gain moving so far away from templates.

I'm looking at how to re-integrate the use of layouts in the app, I'm hoping it's not going to be too cumbersome.

Your thoughts?

Add Support for other ORMs

First of all great job on active_admin! Impressive and really easy to get up and running.

Any plans to support other ORMs like Mongoid?

best way to add actions

Hy guys, awesome work!

What is the best way to add custom actions, like "approve"? Where I'm supposed to config routes and this kinda stuff?

Thanks in advance.

Creating Custom Filters

I'm trying to create a custom filter to no avail. I need to be able to take a numeric search and check it against multiple rows, the exact number of rows being another input for the filter. Is there anyway to create a custom filter like a custom view?

Added admin resource, getting "wrong number of arguments" error

I added an admin resource for my event model and I'm getting this error:

wrong number of arguments (1 for 3)

(For what's it's worth I added one for another model and it works great).

Here's a full trace:

activerecord (3.0.1) lib/active_record/relation.rb:360:in `search'
activerecord (3.0.1) lib/active_record/relation.rb:360:in `send'
activerecord (3.0.1) lib/active_record/relation.rb:360:in `method_missing'
activerecord (3.0.1) lib/active_record/relation.rb:120:in `scoping'
activerecord (3.0.1) lib/active_record/relation.rb:360:in `method_missing'
activeadmin (0.2.1) lib/active_admin/resource_controller/collection.rb:66:in `search'
activeadmin (0.2.1) lib/active_admin/resource_controller/collection.rb:62:in `active_admin_collection'
activeadmin (0.2.1) lib/active_admin/resource_controller/collection.rb:85:in `active_admin_collection'
activeadmin (0.2.1) lib/active_admin/resource_controller/collection.rb:119:in `active_admin_collection'
activeadmin (0.2.1) lib/active_admin/resource_controller/collection.rb:17:in `collection'
inherited_resources (1.2.2) lib/inherited_resources/actions.rb:7:in `index!'
activeadmin (0.2.1) lib/active_admin/resource_controller/actions.rb:10:in `index'
actionpack (3.0.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.1) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.1) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.1) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.0.1) lib/active_support/callbacks.rb:455:in `_run__1213832932__process_action__199225275__callbacks'
activesupport (3.0.1) lib/active_support/callbacks.rb:409:in `send'
activesupport (3.0.1) lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks'
activesupport (3.0.1) lib/active_support/callbacks.rb:93:in `send'
activesupport (3.0.1) lib/active_support/callbacks.rb:93:in `run_callbacks'
actionpack (3.0.1) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.0.1) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.1) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.1) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.1) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.1) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.1) lib/abstract_controller/rendering.rb:40:in `process'
actionpack (3.0.1) lib/action_controller/metal.rb:133:in `dispatch'
actionpack (3.0.1) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.1) lib/action_controller/metal.rb:173:in `action'
actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.1) lib/action_dispatch/routing/route_set.rb:492:in `call'
haml (3.0.23) lib/sass/plugin/rack.rb:41:in `call'
warden (1.0.3) lib/warden/manager.rb:35:in `call'
warden (1.0.3) lib/warden/manager.rb:34:in `catch'
warden (1.0.3) lib/warden/manager.rb:34:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/cookies.rb:287:in `call'
activerecord (3.0.1) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.1) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.1) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.1) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.1) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.1) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
actionpack (3.0.1) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.1) lib/rails/application.rb:168:in `call'
railties (3.0.1) lib/rails/application.rb:77:in `send'
railties (3.0.1) lib/rails/application.rb:77:in `method_missing'
passenger (3.0.0) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.0) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.0) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.0) lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
passenger (3.0.0) lib/phusion_passenger/rack/application_spawner.rb:170:in `send'
passenger (3.0.0) lib/phusion_passenger/rack/application_spawner.rb:170:in `handle_spawn_application'
passenger (3.0.0) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.0) lib/phusion_passenger/rack/application_spawner.rb:165:in `handle_spawn_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.0) lib/phusion_passenger/rack/application_spawner.rb:128:in `start'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.0) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.0) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.0) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.0) helper-scripts/passenger-spawn-server:99

Thanks for creating this, very nice and well documented.

to_param routing issue

In one of my models, I have this code to make the show url the name of the model only, with no ID number.

  before_validation :update_or_create_slug

  def to_param
    slug
  end

  private
  def update_or_create_slug
    if self.new_record? || self.name_changed? || self.slug.blank?
      self.slug = self.name.parameterize
    end
  end

This alters my activeadmin link to the form to be admin/model/n-a-m-e, which doesn't work. If I manually go to the URL admin/model/1, or any other id number, it does work.

Any ideas?

Warning when calling attributes_table_for: warning: multiple values for a block parameter (0 for 1)

In the same light as the demo app:

sidebar :customer_information, :only => :show do
  attributes_table_for order.user do
    row("User") { auto_link order.user }
    row :email
  end
end

My code:

show :title => :name do
  panel "AppServer Details" do
    attributes_table_for app_server do
      row :name
      row :internal_ip
      row :external_ip
      row :username
      row :password
      row :spla
    end
  end

Will generate the following warning:

/servercommander/app/admin/db_servers.rb:20: warning: multiple values for a block parameter (0 for 1)
    from /home/thomas/.bundler/ruby/1.8/active_admin-bc4e65999763/lib/active_admin/views/components/attributes_table.rb:48

The code runs and displays correctly but there is a warning that comes back when I navigate to these show actions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.