mirror of
				https://github.com/sinatra/sinatra
				synced 2023-03-27 23:18:01 -04:00 
			
		
		
		
	* Only add :format to routes if otherwise not explicitly set.
-- This allows us to remove the need to responds_to. -- In other words... In the event of /foo.xml.. In the event of /foo.json...
This commit is contained in:
		
							parent
							
								
									0315f4bfb2
								
							
						
					
					
						commit
						3e085f52db
					
				
					 7 changed files with 19 additions and 71 deletions
				
			
		| 
						 | 
				
			
			@ -1,7 +0,0 @@
 | 
			
		|||
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib/'
 | 
			
		||||
require 'sinatra'
 | 
			
		||||
 | 
			
		||||
get '/' do
 | 
			
		||||
  format.html { body 'blake' }
 | 
			
		||||
  format.xml { body 'test' }
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +0,0 @@
 | 
			
		|||
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib/'
 | 
			
		||||
require 'sinatra'
 | 
			
		||||
 | 
			
		||||
get '/test/:name' do
 | 
			
		||||
  params[:name]
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -1 +0,0 @@
 | 
			
		|||
<%= 1 + 3 %>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue