I’ve developed a simple Rails blog application that I’m hosting with Dreamhost. I have a login page which allows the blog administrator, i.e. me, to login and create new blog posts, etc. At the moment I’m having a problem with the login page which has a form asking for username and password and a submit button.
I think that the problem I am getting is centred around a ‘redirect_to’ call. Basically, when my application acknowledges a successful login a ‘redirect_to’ command should redirect the browser to the main blog admin. page. Most of the time this doesn’t happen and instead I am seeing a dialogue box in Firefox stating, “You have chosen to open blog which is a: BIN file”. “blog” is the name of the admin. page I’m trying to access.
I’ve tried accessing the site using MS Explorer which gives a dialogue box which mentions an application/octet-stream.
Does anyone have any ideas?
This is the first site I've hosted and the site works absolutely fine locally. I've posted on a number of dedicated Rails forums and haven't really got anywhere. The problem does not occur consistently and occurs in both MSIE and Firefox. I've tried Dreamhost tech. support and they seem to think that the servers are configured properly.
One thing I feel I should mention is that I've had to create new map.connect entries in my routes.rb file so that some of the pages are located correctly. On my local copy I had some routes set-up but I didn't have to define every single route. Not sure why that is.
Sorry I was going to post my code when I discovered that I couldn't place links in my post due to the fact that I've not posted before. Didn't think of just posting the address! Doh! I've used pastie to show some of the code, it can be found at:
1) Check the versions of Rails on the respective locations. Also, what are you using on your local server to serve it? WeBrick? Mongrel? DH uses Phusion Passenger.
2) Your router code looks like you're fighting with REST. You might want to take a second look at it. It may not be entirely necessary; at first glance it just looks to me like you're overworking the router.
3) Just to ensure the routing is correct, try a rake routes on both locations and compare the routing list.