EDIT: I feel so stupid, I wasn’t merging my branches properly with git. Like I said, I am quite new to programming and am prone to these types of errors. I appreciate the help, though.
I am on ch. 7 of the Rails by Example book, where I created a basic “Sign up” form. When I submit the form on my localhost, it works properly by directing me to either
LOCALHOST/new (back to sign up page, registration info error) or LOCALHOST/show (user profile, success).
When I push this same app to heroku and hit the submit button, it always leads me to this url:
appname.heroku.com/form_action.asp?fname=&email=&password=&password= which tells me
“The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved.”
Instead of appname.heroku.com/new or /show.
I am so confused, I am a beginner programmer and it boggles my mind why things work so perfectly on the localhost but not on the production server. Please help!
My code is on github:
https://github.com/Chamza/Sample-App2
Are you running the ‘cedar’ stack on Heroku? I believe the url should be
appname.herokuapp.com— notappname.heroku.com. Since your code in github is based using rails 3.2.1, you should be using the cedar stack.Here’s some information on the cedar stack from heroku: https://devcenter.heroku.com/articles/cedar
Also, can you run
heroku logs --tail --app my-app-nameand then post what happens when you click the link? That’s known as ‘tailing the log’ and it will give you real-time output of what’s happening.EDIT***
I looked at your code and I can see that at least one problem is the form you’re using has:
There are a few errors in the form. First, the action is to
form_action.asp. That looks like it came from an old project. Second, the end</div>and</form>tags are switched — the form tag should be before the div tag.It’s likely that your local machine has different code on it than what you have deployed on Heroku. I’d check carefully — do a
heroku releases --app my-appand it will tell you what the latest git commit is on the server.