This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def accept | |
@estimate.update!(status: true) | |
redirect_to @estimate | |
end | |
def reject | |
@estimate.update!(status: false) | |
redirect_to @estimate | |
end |