Skip to content

Instantly share code, notes, and snippets.

View adrianmann's full-sized avatar

Adrian Mann adrianmann

View GitHub Profile
def accept
@estimate.update!(status: true)
redirect_to @estimate
end
def reject
@estimate.update!(status: false)
redirect_to @estimate
end
# app/models/vendor.rb
class Vendor < ActiveRecord::Base
has_many :products
# Rest of the code …
end
# app/models/product.rb
class Product < ActiveRecord::Base
belongs_to :vendor