SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    redirect_to causing problems at Dreamhost-ed site

    Hi

    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.

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Akron, OH, USA
    Posts
    99
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Post your code so that we can take a look!

  3. #3
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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:

    h-t-t-p: //pastie.org/386202

  4. #4
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some quick suggestions to get you started:

    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •