ruby - Why does '/' match correctly to a Rack application in my Rails 3 app, but no other route does? -


i'm using rails 3.0.6.

in lib directory have example_app.rb, sinatra app:

class exampleapp < sinatra::base   '/'     "hello sinatra"   end end 

and i'm autoloading application.rb config.auto_load_paths configuration.

in routes file, have only:

match "/" => exampleapp 

and matches fine when run rails server (webrick). if try:

match "/example" => exampleapp 

visiting localhost:3000/example gives me 'no route matches "/example"' error. running rake routes shows route though:

example  /example(.:format) {:to=>exampleapp} 

if try , match '/example' against controller action works fine, not sinatra app above, i'm not sure what's going on. know there's small i'm missing i'm not finding in routing documentation on rails site.

thanks help.

the problem sinatra app responds requests made /. need either add

get '/example' 

or wildcard match using *

get '*'   "hello sinatra" end 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -