I’ve been trying to do this for two weeks and I am still stuck. Now, my situation is this:
With no user session started, if I enter this url in the brower: http://localhost.../something?a=1&b=2 it shows the subscription with the attributes a = 1 and b = 2. Everything OK.
If I edit something of the subscription everything goes OK, but the problem is that the url changes to http://localhost.../subscription/id.
What I want is that when I modify something in the subscription the url must be http://localhos.../something?a=1&b=2 instead of the http://localhost.../subscription/id.
routes.rb
…
match "/something" => "subscriptions#show"
…
subscription_controller.rb
…
def show
@subscription = Subscription.find(params[:id] || Subscription.find_by_token_and_networkId!(params[:t], params[:nwk]))
…
I don’t want to became the /subscription/id url useless because I want to access it from another part of the webpage.
In the controller update method, try this before the closing tag:
Currently, you probably have something like: