lemon-spoon-80671
03/10/2023, 12:17 PMbelongs_to :session
has_many :session_execution_attendances
has_many :farmers, through: :session_execution_attendances
and I would like to hide the "Create new farmer" button in the "session execution" show. In my "session_execution_policy.rb" I have tried this:
def create_session_farmers?
false
end
but without success.
Could it be that I am missing something because of the has_many through relation? Thanks.lemon-wall-20836
03/10/2023, 12:18 PMlemon-wall-20836
03/10/2023, 12:18 PMdef create_{association}?
method must match the if of the field, which matches with the association namelemon-wall-20836
03/10/2023, 12:19 PMfarmers
so the methdo should be create_farmers?
lemon-wall-20836
03/10/2023, 12:19 PMlemon-spoon-80671
03/10/2023, 12:22 PMlemon-spoon-80671
03/10/2023, 12:23 PMlemon-wall-20836
03/10/2023, 12:32 PMlemon-wall-20836
03/10/2023, 12:32 PM