I have the following problem. My App (a prototype of an api) should be able to react on params (like language). I'm already able to respond to an request by sending an entierly object (with associated objects included) as JSON. But now i want to select the associated objects by parameter. my code:
object.to_json(include => {
:texts_in_diff_languages => {
#here i should be able to select only languages equal to a given parameter (params[:language])
}
})
Do you have any idea? Thanks!