Basically, I would like to be able to create different serialization_hash 
depending on "roles". Here's an example of what I think could be helpful:

controller:

render :json @clients, as: :search
OR
render :json @clients, as: :contract_won


ActiveModel::Serializers::JSON

def attributes 
//default
end

def contract_won
// as: :contract_won
end

def search
// as: :search
end


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/oyBsDOl1qaQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to