Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 736 Bytes

aasm_integration.md

File metadata and controls

39 lines (29 loc) · 736 Bytes

AASM Integration

State Row

show do
  attributes_table do
    # another attribute...
    state_row :state
  end
end

State Column

index do
  # another attribute...
  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; }
}