3

I'm working on a Rails 3.2.13 app, and I ran rails server.

The server works fine, but only until I tried render this page:

localhost:3000/items/1/edit

From this point on, any page I try to go to wouldn't get loaded. The strange thing is, there are no error messages shown on the log. The log just looks like it stopped responding.

As more background information, this morning I tried switching from sqlite to MySQL, and before that, the rails server worked just fine. I then gave up on the installation of the mysql gem (because of the error), and went back to my old database.yml and gemfile, so I don't suppose the installation attempt would've affected it.

Does anyone have any idea what is happening?

Community
  • 1
  • 1
jytoronto
  • 558
  • 3
  • 10
  • 18

2 Answers2

4

A few ideas:

Try running rake routes (in the command line of your current working directory, not in the server)just to make sure you're item/:id/edit exists.

if it doesn't work you'd want to run something to the tune of

resources :items

If you only want to show the new and edit routes, try this:

resources :items, only: [:edit,:new]

If that's not the case, check to see if your item/:id/edit is set to be a get and not a post. If it's a post, and you're not posting, it will not work.

Finally, be sure to run bundle update.

The only other issue I could consider is you might have created a blank edit.html.erb view with nothing showing up.

Noah Koch
  • 831
  • 8
  • 10
0

Finally figured it out. Turns out I was rendering a partial that broke the page. Now the problem is fixed.

More specifically, I had a embedded ruby while loop in the partial, and the stopping condition was never met. So essentially I was rendering an infinite loop, which explains the unresponsive behavior.

jytoronto
  • 558
  • 3
  • 10
  • 18