Pick id from URL Routing

37 views
Skip to first unread message

till haxor

unread,
Feb 18, 2014, 10:55:02 PM2/18/14
to chica...@googlegroups.com
Hello, I write the following:

I've been watching my project chicagoboss uses identifiers as "model-1" or "test-1", I tried to do a direct search to view information for that id, but whenever I try to pass as a parameter the id, only gave me a 'not found "

My route was:
{"/ admin / test / (? <test_id> \ \ d +)", [{controller, "main"}, {action, "test_edit"}, {id, "$ test_id"}]}.

but could only pass a number by regular expression, then actualize my route:

{"/ admin / test / ((\ \ w +) - (\ \ d +))", [{controller, "main"}, {action, "test_edit"}, {id, '$ 1'}]}.

and wanted to know if this is the right way to expected.

sorry for the bad English.

David Welton

unread,
Feb 19, 2014, 4:09:26 AM2/19/14
to chica...@googlegroups.com
Hi,

> I've been watching my project chicagoboss uses identifiers as "model-1" or
> "test-1", I tried to do a direct search to view information for that id, but
> whenever I try to pass as a parameter the id, only gave me a 'not found "

CB is a bit strange this way in that the ID the Erlang code see is
like what you wrote, but what's in the DB is just 1 or 2 or whatever,
in the 'id' field. So if you want to access the DB directly, you need
to just use the number.

--
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/
Reply all
Reply to author
Forward
0 new messages