Hello, I am having a weird issue where even thoug...
# cfml-beginners
o
Hello, I am having a weird issue where even though I routed my form to a different action it still defaults to the default action
index
. I have no idea why as I am new to ColdFusion. Here is a code snippet https://gist.github.com/ookma-kyi/2cc0ae7f8d7920d6c3d5b66bcbdca355.
a
Sounds like this is a question about ColdBox routing, rather than CFML, per se? What is the URL that gets generated the form action? Is it resolving the URL correctly there, or is it not routing properly even with the intended URL in the action? (NB: I know nothing about ColdBox).
o
Updated gist:
<form method="POST" action="<http://127.0.0.1:8080/resetpassword>">
which is routed to the create method as per the router rule.
r
Agreed. FYI, assistance for ColdBox can be found in the #box-products channel. Please be aware that Ortus is hosting pre-conference sessions for their Into The Box conference so responses from them their very helpful employees may be slow.
o
Didn't know if it was my code or an issue with Coldbox itself. Should I move this thread to #box-products?
a
It can be an issue with your code and how yer using ColdBox. Well: that will be exactly what it is 😉 If yer talking about raw CFML code: it belongs here; if you have a question about how a specific CFML app works (eg: ColdBox), then it belongs on the app-specific channel.
r
I don't know ColdBox, but is this being called from the index page?
o
yes trying to make nice url's
r
My guess is you have errors in your create method so the view never gets set and defaults to index.
o
Getting closer, if I submit the form successfully I get the right view. Only when I submit the form with errors does it mess up. What's weird is instead of showing the form with errors it tries to redirects to the
index
action which is expecting a query in the URL and thus failing. Most likely something to do with this line: https://gist.github.com/ookma-kyi/2cc0ae7f8d7920d6c3d5b66bcbdca355#file-handlers_resetpassword-cfc-L51