I have a Ruby on Rails app that I would like to have use modular
Sinatra code in. How can put those modular pieces into my rails app?
--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.
Sinatra is rack app so check ouda yahud's posa
On Wed, Apr 18, 2012 at 12:13 PM, soldier.coder <geekprogrammer.ed@googlemail.com> wrote:
I have a Ruby on Rails app that I would like to have use modular
Sinatra code in. How can put those modular pieces into my rails app?
--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+unsubscribe@googlegroups.com.
> Unfortunately, this does not speak to my question. The article you posted
> talks about how to re-write Sinatra code as Rails code. What I want to do
> is keep Sinatra and somehow let Sinatra do what it does and pass info back
> to rails. On the rails side, I want to create a route to my Sinatra code.
> How do I do that?
Assuming you're using Rails 3, it's as easy as this:
# in routes.rb
match "/blog" => MySinatraBlogApp
If you're using Rails 2.3, it's a bit more complicated, but basically you can insert your Sinatra App as middleware, and then just pass through all the things you don't want your Sinatra app to handle.
g, Markus