Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 741 Bytes

aasm_integration.md

File metadata and controls

37 lines (28 loc) · 741 Bytes

AASM Integration

State Row

show do
  attributes_table do
    state_row :state
  end
end

State Column

index do
  state_column :state
end

The name of the state will be the class name (rejected, approved, etc.), but you can pass a hash of options to map different states with tag colors.

state_column(:state, states: { destroyed: "rejected" })

You will need to define inside your_app/app/assets/stylesheets/active_admin.css.scss the following:

.status_tag {
  &.rejected { background: $rejected-color; }
  &.approved { background: $approved-color; }
}