DEV Community

Discussion on: How to add "Preview Mode" style functionality to a Rails application

Collapse
 
edisonywh profile image
Edison Yap

I believe it's enough to just do enum status: %i[draft published] and Rails will generate the magic accessor methods for you.

Might be a good idea to make a Constant though so you can reuse it in controller/elsewhere.

api.rubyonrails.org/v5.1/classes/A...