web controllers - postprocess the response before template got rendered and extend its parameters list

30 views
Skip to first unread message

Evgeny M

unread,
Sep 5, 2014, 10:32:29 AM9/5/14
to chica...@googlegroups.com
Hi,
I need to add the same variable (same name and value) to every {ok, [..variableslist..]} response of every method of a controller. In other words, postprocess the response before template got rendered and push a new variable into parameters list.
Is there an easy and nice way to do so? There are quite a few methods, don't want do change them all.

Dmitry Polyanovsky

unread,
Sep 6, 2014, 12:44:24 PM9/6/14
to chica...@googlegroups.com
Hi,
there is two possible ways I can think about:
1) return that variable in before_  function, so it will be available as _before.var in templates
2) put it into session at some point and it will be available as _session.var




--
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 chicagoboss...@googlegroups.com.
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/67924393-3ef5-43b5-93f5-d4469c108fd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Evgeny M

unread,
Sep 6, 2014, 1:35:54 PM9/6/14
to chica...@googlegroups.com
Thank you! the variant with session is exactly what I looked for, as the variable is stored in the session anyway.

суббота, 6 сентября 2014 г., 20:44:24 UTC+4 пользователь Dmitry Polyanovsky написал:

Dmitry Polyanovsky

unread,
Sep 7, 2014, 1:55:37 AM9/7/14
to chica...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages