hi,
i do like this
-module(toto, [Id, Name, Private, NotPrivate]).
-export([public/0]).
public() ->
Attrs = [id, name, not_private],
[{X,THIS:X()}|| X <- Attrs].
in your controller:
============
instead of Record:attributes()
you call Record:public()
if you have a list of record,
[X:public() || X <- ListRecord].
regards.
chan
2014-06-17 17:16 GMT+08:00 Neil Pahl <[email protected]>:
> I like the feature of serializing the BossRecord automatically when
> returning a json via the web controller:
>
> {json, Data::proplist()}
>
> Return Data as a JSON object to the client. Performs appropriate
> serialization if the values in Data contain a BossRecord or a list of
> BossRecords.
>
> However, I usually have fields containing information I don't want to
> share with the client. I think it would be pretty convenient if there was a
> feature that would serialize only the fields which you ask for? something
> like:
>
> {json, Data::proplist(), [Key::atom()]}
>
>
> In the meantime, anyone have a good method of getting a list of
> proplists(of only chosen fields) from a list of BossRecords? or of
> serializing select fields of your BossRecords?
>
> --
> You received this message because you are subscribed to the Google Groups
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chicagoboss/675a6988-8762-4fac-b9a0-a204b685b52e%40googlegroups.com
> <https://groups.google.com/d/msgid/chicagoboss/675a6988-8762-4fac-b9a0-a204b685b52e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit
https://groups.google.com/d/msgid/chicagoboss/CAB-OfhnZgAmOraZj2syE5mQzGJDVBA4Jj25%3DyhTd6X_bZ09NYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.