Modular Sinatra with Ruby on Rails...

55 views
Skip to first unread message

soldier.coder

unread,
Apr 18, 2012, 1:13:29 PM4/18/12
to sinatrarb
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?

Don Hill

unread,
Apr 18, 2012, 8:45:49 PM4/18/12
to sina...@googlegroups.com
Sinatra is  rack app so check ouda yahud's posa
On Wed, Apr 18, 2012 at 12:13 PM, soldier.coder <geekprog...@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+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.


soldier.coder

unread,
Apr 22, 2012, 11:48:28 PM4/22/12
to sina...@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?


On Wednesday, April 18, 2012 8:45:49 PM UTC-4, ssswdon wrote:
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.

Markus Prinz

unread,
Apr 23, 2012, 6:11:11 AM4/23/12
to sina...@googlegroups.com

On 23 Apr 2012, at 5:48 , soldier.coder wrote:

> 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

Reply all
Reply to author
Forward
0 new messages