Rails Dispatch

Rails news delivered fresh

Presented by Engine Yard

View Question

Vote on questions you’d like to see answered by the expert contributors

Signup to ask questions or vote for the questions you’d like to see answered.

Hey Rizwan,

Thanks for your article on rails routing.
I have a remark however. You’re all publicizing this new great router and it is great (both the fact that you’re publicizing it and the router).

However before to say out loud “you can route sinatra apps”, you should, I think, check that it effectively works.
Routing basic rack apps works. But routing sinatra apps it defunkt.

See my ticket on lighthouse : https://rails.lighthouseapp.com/projects/8994/tickets/4478-impossibility-to-mount-a-sinatra-app#ticket-4478-1

Cheers
Damien

Asked May 13, 2010
Rizwan Reza answered
Answer

Hey Damien,

Thanks for bringing this up. I can say that the way mounted Sinatra application worked has changed a bit. I agree that the article is not showing this way, since like you, I also think it needs to be fixed. But it seems you imply that we cannot mount Sinatra applications to Rails at all, which is definitely not true. I’ve generated a sample Rails application and pushed it to Github. Have a look: http://github.com/rizwanreza/sinatra-rails

The thing I would like to see get fixed is that we shouldn’t do match ‘/sinatra(/:string)’ => SinatraApp but rather match ‘/sinatra’ => SinatraApp and the Sinatra application should go on from there, as I detailed. This is how it worked before. I am going to ask Joshua Peek (who worked on Router) to let us know how we can fix this. We would certainly love a patch from you as well. :)

Thanks once again.

Rizwan

Answered May 13, 2010