I currently need to pass some methods as parameters in order to render json properly:
render json: @objects.to_json(methods: [:num_of_properties])
This syntax currently works. However, there is another method I want to pass; this method takes in 1 argument.
I figured this would work:
render json: @objects.to_json(methods: [:num_of_properties, :property_is_owned_by?(current_user)])
This does not work. Is this even possible to do? I figured that if you can pass methods as arguments in the first place, you must be able to pass methods that take in arguments. But I don't know. I'm not too familiar with Ruby.