-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plug into middleware? #10
Comments
You don't need to use rails3 routes. Grape is a rack application and should be loaded alongside your rails application. Stick something like this in your
|
Cool, how would that work with using models and helpers and how would the routes look like? |
Forget routes! This is a rack middleware that constructs its own routes using the DSL (much like a sinatra application would). Perhaps you should create a pretend API outside of your rails application to better understand how middleware works. |
Yeah I figured that out. But how would interacting with Rails models, gems and helpers work. |
If you keep it within your rails application, and load it alongside the rails environment (also add it to your Devise would just sit over the top—although I'd look into the authenticated examples that are in the sinatra demo app that intridea created for you :) |
How would one go through to plug this into middleware without using the Rails 3 routes?
Because using the routes would put it at th bottom of the stack.
Would save me time from implementing my own dsl... again.
The text was updated successfully, but these errors were encountered: