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?