0

In my routes.rb file i have like below

get 'homes-detail/*property_slug',
      to: 'property_details#show',
      as: :property_details, format: false,
      constraints: IgnoreSpecialCharactersConstraint.new(:property_slug, false, "&")
  end

I am doing redirect_to show page of the property page like this.

url = property_details_path(property_slug: permalink_slug, prop_status: @property.property_status)
redirect_to((url),
        status: 301
      )

But when the browser reloads it loads the page with query params like below.

http://localhost:3000/homes-detail/100-Bresco-CIpolo_TX_UXC7678C-71211?prop_status=for_rent

But i need to remove prop_status=for_rent from the above url and return only

http://localhost:3000/homes-detail/100-Bresco-CIpolo_TX_UXC7678C-71211

How can i do it?

rubyist
  • 3,074
  • 8
  • 37
  • 69
  • http://stackoverflow.com/questions/6338870/how-to-implement-a-short-url-like-urls-in-twitter – Techidiot Sep 19 '16 at 10:54
  • 1
    If you don't want query params submitted in the url you'll need to change your route to a 'post' instead of a 'get' in your routes file. – bkunzi01 Sep 19 '16 at 11:45

0 Answers0