-
Notifications
You must be signed in to change notification settings - Fork 335
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
Layouts or smth similar #87
Comments
I could see the value for layouts, if there's a certain template all your API's take the form of with a |
For instance, I have an app and I need some fields to present in each response: it's for layout, I think. Without them I should add some I'll try to code this and pull request, I hope it'll be helpful for somebody. |
Yeah I can definitely see the value, if you send a pull request with specs and it works well for you im happy to pull it in for the next release. |
Fine, I will pull it soon. |
Thanks |
I'm interested in this functionality, too. @ognevsky, have you made any progress with an implementation? I've taken a look at the source for Rabl, but I'm not really sure where to start with implementing layout functionality. |
Thanks, @nesquena. That works for me. My trouble before was trying to use a .rabl file instead of a .erb file, i.e.
Which results in the error "no block given (yield)" It's a bit of a shame that we need to switch to .erb for the layouts, but hopefully layout files aren't too complicated so it's no major loss. I'm happy enough to move ahead with .erb files. |
Yeah that seems to work for me alright as well, as you said its a shame you need to switch to .erb but in the long run the layouts are fairly simple anyhow. Cheers. Still happy accept a patch for more "complete" support though. |
@nesquena I made this like So, when my layout contains So, this code above works (it should work, as I see), you can close this issue I think. No need to make layouts as additional code.
|
No problem, thanks for following up. I agree this is a "good enough" solution. Would anyone be kind enough to help document this approach on the wiki for others? https://github.com/nesquena/rabl/wiki/Using-Layouts @ognevsky @peterjm @cblavier . |
Hi,
As I know, Rabl don't have any layouts yet. So, the question is: do somebody need this?
The text was updated successfully, but these errors were encountered: