I have two models here: Package
and Status
Package belongs_to
status
Status has_many
packages
So, my Package model has a status_id
column
In my Packages controller, I've got this method (that receives data from an ajax POST call):
def edit_status
@status = Status.find_by_name(params[:status])
Package.update(params[:id], :status_id => @status.id)
end
But it's weird...I can't get status_id
to update to save my life. If I change out the status_id
column for any other column in the record (such as from_name
) then it works fine.
I feel like I'm taking crazy pills here, but any ideas why this might not be working?