Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3670874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:25:06+00:00 2026-05-19T02:25:06+00:00

I am redirecting a POST request to ensure the URL is correct along with

  • 0

I am redirecting a POST request to ensure the URL is correct along with other things. The redirect worked fine before I added in the if statements for town below:

if !params[:address].blank?
  town = Town.find(:all, :conditions => ["name = ?", params[:address]])
  @towns = town
  if !town.blank?
    redirect_to '/town/' + params[:address]
  else
    @town_invalid = 'test'
  end
end

end

I am sure it is something simple and that I simply cannot see it. Also if you see any glaring errors or code mishaps let me know as I am just starting out.

EDIT: I should mention this is what I get back from Safari when a real town is entered:

Safari can’t open the page.Safari can’t open the page “http://localhost:3000/” because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:25:06+00:00Added an answer on May 19, 2026 at 2:25 am

    You need to url encode the params[:address].

    redirect_to '/town/' + u(params[:address])
    

    url encode equivalent in ruby on rails

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you go about redirecting a browser and sending a HTTP POST request
I have a page that is making an XML POST-Request to an URL on
I am using HttpClient to do Post request to a server URL. The server
I'm redirecting this URL: http://mydomain.com/expandyourtaste Using this .htaccess file: #Expand your tastes redirects Redirect
When processing a POST request in the Django views.py file, I sometimes need to
I am using the Redirect After Post pattern in my ASP.NET MVC application. I
If F5 is pressed after a POST request has been issued, browser will ask,
I have one question about redirecting in ASP.NET. I know how to redirect with
I would like to create redirect response with POST parameters. For example controller returning
I'm having problems redirecting stdio of another program using subprocess module. Just reading from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.