How to pass values into partials #1645
Unanswered
tg-mvooges
asked this question in
Q&A
Replies: 1 comment
-
Current solution:
With the snippet:
Which ends up in the docs like this: $result = $yourApiClient->get('givenUrl'); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have zero experience with Ruby so maybe this is super simple, but I'm using partials in my docs as that significantly makes things actually maintainable. I have multiple code examples like this (these are minimal, just as example):
They're mostly the same and I have a lot of exactly that snippet, just with a different url. I want to make this codeblock into a 'simpleCodePreview.md.erb' which I can pass an url into.
According to what i've found only, something like this should work:
Using it like this:
However, this becomes (something along the lines of):
Is there any way to use variables in partials/renders?
Beta Was this translation helpful? Give feedback.
All reactions