I have my Product model that has the attribute private. I want to make a method that allows the current user to be able to select their private products and others that are private = false only.
class Product < ActiveRecord::Base
attr_accessible :name, :private
belongs_to :user
def permission
unless self.current_user
unless self.private
end
end
end
end
Does it start out like this? How would I write this method? The goal is to put this inside of a select menu.
I would create a class method for this which you would pass something like
current_usertoUsage:
As for the select, something like the following should work