http://www.chicagoboss.org/api-controller.html , see Authorization section

before_(_,_,_)->
 case some_func_result(Req) of 
   false -> {redirect,"http://yahoo.com"};
   {true,Data} -> {ok, Data}
 end.

hi('GET',[], Data)->
{output,"ok"}.

hello('GET',[], _)->
{output,"ok"}.

the code is from the top of my head, so please, doublecheck.

On Wednesday, October 22, 2014 2:36:56 PM UTC+4, Jitin Luthra wrote:
>
> Hi,
>
> I am using a before_ function in my controller and have some actions in my 
> controller with only two arguments. 
> However, the before_ function gets called even for those actions with two 
> arguments. 
> Did it not used to be that the before_ code would only get called for 
> actions having 3 arguments?
>
> Sample code:
>
> -module(test_hello_controller,[Req]).
> -compile(export_all).
>
> before_(_,_,_)->
> {redirect,"http://yahoo.com"}.
>
> hi('GET',[])->
> {output,"ok"}.
>
> When trying to load the 'hi' action, I get redirected to yahoo.com .
>
> Thanks,
> Jitin
>
>

-- 
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/8ea58d5d-a5e6-4220-b808-d2ac95b5d9e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to