Though this is a good suggestion, I am not sure it would work in this
application. I'm already including sub-data from associations in this way,
but these parameters are quite literally **arbitrary** and have nothing to
do with the model itself, besides telling the DataTables script how many
items it's supposed to show. And that's based on filters and probably needs
to be figured out programmatically based on what the filter requests are.

*Elanor Riley*

*Dynamic Web Application DeveloperGraphic Designer*

On Tue, May 30, 2017 at 5:37 PM, Igor Fontana <[email protected]>
wrote:

> > Is there a way to add arbitrary parameters to the JSON output from
> Sequel?
>
> you can
>
>   stuff.to_json(include: :some_method)
>
> or perhaps
>
>   stuff.to_json(include: { some_method: { include: :some_deep_method } })
>
> you just need to define those methods.
>
> if you dont want this kind of logic into your models, you can:
>
>   {
>     stuff: stuff,
>     some_method: {
>       some_deep_method: 666
>     }
>   }.to_json()
>
> --
> dota? =op
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sequel-talk" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/sequel-talk/FOQ_09mizKw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sequel-talk.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to