That's it. I need to redirect just the POST requests. Something like:
rewrite /.*/, '/universal_POST_handler', :if => (something_cool_goes_here)
Is it possible?
That's it. I need to redirect just the POST requests. Something like:
rewrite /.*/, '/universal_POST_handler', :if => (something_cool_goes_here)
Is it possible?
The purpose of a rewriter in an application that has routing is to rewrite legacy URLs to more current URLs. Legacy URLs are URLs that were supported and that external users have come to depend on but that are no longer supported because the architecture of the application has changed.
You should use the router instead.
post '*path' => 'actions#universal',
:constraints => FancyConstraint.new
From the README:
Using the :method
option you can restrict the matching of a rule by the HTTP method of a given request.
r301 "/players", "/current_players", :method => :get
r302 "/players", "/no_longer_available.html?message=No&longer&supported", :method => :post