routes - Rails Routing - Reject any/all extensions? -


i want make request /session/update , return json response. have working right following route:

get 'session/update', to: 'user_sessions#keep_alive' 

however, route allows requests have type of extension tacked on end of (/session/update.txt, /session/update.abc123, etc.). how can write route rejects request includes extension? want lock down responds /session/update.

you can constraints below

scope :format => true, :constraints => { :format => 'json' }   'session/update', to: 'user_sessions#keep_alive' end 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -