# How to implement a status table

**URL:** <https://www.ruby-forum.com/t/how-to-implement-a-status-table/165528>\
**Category:** Rails\
**Created:** [April 14, 2009, 10:03pm UTC](https://www.ruby-forum.com/t/how-to-implement-a-status-table/165528 "2009-04-14T22:03:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 14, 2009, 10:03pm UTC](https://www.ruby-forum.com/t/how-to-implement-a-status-table/165528/1 "2009-04-14T22:03:57Z")

</div>

I have a from that will have a status, “approved”, “in  
process”,denied"… and such.

What is the best approach?  
Status table,  
One row with each column status type?  
The form will have only one status so I will have to manage making  
sure all columns that are not “true” will be false.

If I set it up so I populate the table with each row being a status  
type then it will be easier to implement.  
I could have a drop down to change status dynamically…

Any ideas?

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 14, 2009, 10:58pm UTC](https://www.ruby-forum.com/t/how-to-implement-a-status-table/165528/2 "2009-04-14T22:58:47Z")

</div>

Chris H. wrote:

> I have a from that will have a status, “approved”, “in  
> process”,denied"… and such.
> 
> What is the best approach?

If a record can only have one status at a time, then it only needs one  
status field.

Consider using aasm – it’s meant for exactly this purpose.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 14, 2009, 11:05pm UTC](https://www.ruby-forum.com/t/how-to-implement-a-status-table/165528/3 "2009-04-14T23:05:27Z")

</div>

Marnen Laibow-Koser wrote:

> Chris H. wrote:
> 
> > I have a from that will have a status, “approved”, “in  
> > process”,denied"… and such.
> > 
> > What is the best approach?
> 
> If a record can only have one status at a time, then it only needs one  
> status field.
> 
> Consider using aasm – it’s meant for exactly this purpose.

This is what Marnen suggested, which I concur:

> **[GitHub - rubyist/aasm: AASM - State machines for Ruby classes](https://github.com/rubyist/aasm/tree/master)**
>
> master

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [April 14, 2009, 11:07pm UTC](https://www.ruby-forum.com/t/how-to-implement-a-status-table/165528/4 "2009-04-14T23:07:22Z")

</div>

OK, cool. thanks, looking now.

On Apr 14, 4:05 pm, Robert W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
