How to work currentAction

12 views
Skip to first unread message

Sergey

unread,
Jan 5, 2013, 8:23:58 AM1/5/13
to xitrum-f...@googlegroups.com
Hello!
How to detect current action in jade view?
I use currentAction
- if (currentAction == MyController.index)

but it not work.

Ngoc Dao

unread,
Jan 5, 2013, 1:29:59 PM1/5/13
to Xitrum web framework
A quick answer is you can use:
if (currentAction.url == MyController.index.url)

I will think if there's a better way.

Ngoc Dao

unread,
Jan 6, 2013, 9:31:11 PM1/6/13
to Xitrum web framework
> I will think if there's a better way.

Currently, the better way is:
if (currentAction.route == MyController.index.route)

I will improve Xitrum so that in the next version, you can simply
write:
if (currentAction == MyController.index)

Thanks for asking.

Sergey

unread,
Jan 7, 2013, 2:07:50 PM1/7/13
to xitrum-f...@googlegroups.com, ngo...@mobilus.co.jp
Thanks!
Reply all
Reply to author
Forward
0 new messages