Quick Add

New in Edge is a Quick Add feature that allows new records to be created on association columns without leaving the new/edit view for the model you're currently working with. This can be very handy if, for example, you're selecting a user from a drop-down and the user you're looking for doesn't exist yet. Clicking on the Quick Add icon next to the drop-down pops up a new window. In this window, you can fill in the fields for the new user, click save, and have the new user show up immediately in the original drop down.

Rake Task

To get started make sure you have run the streamlined:model rake task like so: rake streamlined:model MODEL=<model> to generate the streamlined model files. The files should be generated in app/streamlined/<model>_ui.rb

Customizing columns

Quick Add introduces a new declarative operator, quick_add_columns, which gives you control over which columns appear in the Quick Add dialog. By default, all columns on the model will appear. To only have certain columns appear, use this syntax:

Streamlined.ui_for(Person) do
  quick_add_columns :address, :phone
end

These lines would be added to the app/streamlined/<model>_ui.rb file. I think. Anyone know for sure? And how would this work for Associations?

This works just like the user_columns declaration. Any options that can be passed to user_columns can also be passed to quick_add_columns and vice versa.

Disabling Quick Add

Quick Add is turned on for all associations by default. It can be turned of for associations as needed using the :quick_add option:

Streamlined.ui_for(Person) do
  quick_add_columns :address,
                    :phone,
                    :state, { :quick_add => false }
end

Turning off required field marking

By default, Quick Add reflects on the validations on your model and marks required fields with a red asterisk. This marking can be disabled as needed using the mark_required_fields declaration:

Streamlined.ui_for(Person) do
  quick_add_columns :address,
                    :phone,
                    :state, { :quick_add => false }
  
  mark_required_fields false
end