Not able to match existing route path and getting 404 Not Found

21 views
Skip to first unread message

Yoda

unread,
Apr 24, 2014, 9:46:12 AM4/24/14
to sam...@googlegroups.com
Hello everyone, 

I have following html markup where the action is one of the route path defined in sammyjs routing code:

<form id="loginform" action="#/login" method="post" class="form-horizontal">

<!-- input & hidden elements -->

<!-- submit button -->

</form>

if the above view was loaded via url like "http://localhost:xxx/Account/Login", when I submit the above form, sammyjs logs the error that it is not able to find the route: https://gist.github.com/siddharth-pandey/11254709

I'm not able to to understand why does sammy look for "/Account/Login#/login" as my form action is set to "#/login".

I have also tried changing my script below for the route path mentioned in error above, like from "#/login" to "/Account/Login#/login", but again I get the same error as mentioned in the link above.

this.post('#/login', function (context) {
//process
});

Same happens with other links or form tags. the hash tag that I want to use get suffixed to whatever is in the url like "/Account/Login#{/any_hash_tag}".
What should I do to solve this?

However, everything works fine if the view was loaded via url like "http://localhost:xxx/" that is with no other route parameters.

It would be great to know if there is something that I'm doing wrong.

Cheers

Reply all
Reply to author
Forward
0 new messages