I would like to mount a sinatra application in my rails app.
But I would like this one to share the same layout.
The iframe could work but do you have any other idea ?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You basically need to do two things:
You need to tell the Rails router that a certain URL path is to be handled by another Rack app (in your case a Sinata app). This can be done by adding this to your routes.rb:
Having done that, you can create your app like so:
The second step now is to tell your Sinatra app to use the rails layout which by default lives in
app/views/layouts/application.html.erbfor Rails 3.1. by default, Sinatra uses./views/layout.ext(withextbeing the extension of your chosen template system). So you basically, have to tell Sinatra to./viewsBoth can be achieved by setting the following in your sinatra app: