Skip to content

Instantly share code, notes, and snippets.

@tannerburson
Forked from anonymous/gist:1299378
Created October 19, 2011 19:24
Show Gist options
  • Save tannerburson/1299388 to your computer and use it in GitHub Desktop.
Save tannerburson/1299388 to your computer and use it in GitHub Desktop.
routing sucks
routing:
resources :listings
match '/p/:secret_code' => 'listings#show', :as => "show_listing"
controller spec:
it "should redirect to the listing show" do
post :create, :listing => @attr
response.should redirect_to(show_listing_path(assigns(:secret_code)))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment