You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's see the attributes method inside serializer:
defattributes(options={})attributes=ifoptions[:fields]#options is nil, @options is {:fields=>[:fields1]}self.class._attributes & options[:fields]elseself.class._attributes.dupend
....end
I don't understand where i have to pass the fields options in order to the attributes method get it in these params method.
Why there's an options parameter on the attributes method. Why not use the @options var?
The text was updated successfully, but these errors were encountered:
Hi, I want to be able to filter over attributes like this :
The fields options can be found here : https://github.com/rails-api/active_model_serializers/blob/master/lib/action_controller/serialization.rb
But this does not work. I try to understand a few the code and write something like this and binding inside the attributes method :
Let's see the attributes method inside serializer:
I don't understand where i have to pass the fields options in order to the attributes method get it in these params method.
Why there's an options parameter on the attributes method. Why not use the @options var?
The text was updated successfully, but these errors were encountered: