activeadmin / activeadmin

The administration framework for Ruby on Rails applications.
https://activeadmin.info
MIT License
9.51k stars 3.32k forks source link

[proposal] add opportunity to add a form to resource's sidebar #5108

Closed alex-bogomolov closed 1 year ago

alex-bogomolov commented 7 years ago

Recently a client asked if it is possible to add a form to the index page of resource. It would simplify the process of adding entries with a small amount of columns to the project without the need to click "Add new entry", fill the form, click "Save" and then return back to the index page.

I searched for this feature and realized that it's missing. So I suggest to add the following DSL to the resource:

sidebar_form do |f|
   # ...
end

This DSL will generate a form in the sidebar section under the filters. When a user fills the form and clicks "Create", if the filled values are valid, the entry will be created and he will be redirected back to index page. If the values are not valid, the new action will be rendered.

I think this feature should be added to the project, because it will reduce amount of repetitive actions to do when adding a lot of entities and will improve the usability of ActiveAdmin.

varyonic commented 6 years ago

FYI HE:labs wrote up a 'quick add' feature using fancybox that may be of interest to others. I see your PR was closed after some discussion. I think this might make a good plugin.