lundi 27 avril 2015

Change only one field of model in Rails

In my Rails app I have a model called application ins this model I have a field called status, this is my model

class Application < ActiveRecord::Base
    belongs_to :job
    belongs_to :user

    scope :new, where(:status => 'New')
    scope :reviewed, where(:status => 'Profile Reviewed')
    scope :offered, where(:status => 'Offer Given')
    scope :accepted, where(:status => 'Offer Accepted')
    scope :hired, where(:status => 'Hired')
    scope :declined, where(:status => 'Decline')

I'm wondering if it is possible to change only the status in an modal (all status with checkbox) in the application show page if so what is the best ways to do it, or the status must be a separated model

Aucun commentaire:

Enregistrer un commentaire