Created
November 13, 2009 20:38
-
-
Save vsalbaba/234141 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## pomoci stringu | |
result = "" | |
if condition then | |
result << "neco neco #{kus ruby kodu pro vlozeni do stringu} neco neco" | |
end | |
zapis_to_do_souboru | |
## pomoci eruby | |
context = ERB.context.new | |
context[:nejaka_data] = "nejaka_data" | |
context[:nejaka_jina_data] = "nejaka_jina_data" | |
ERB.render(context, nazev_souboru_s_templatem) | |
## soubor s templatem | |
<% if condition %> | |
todle se sem napise jen kdyz condition plati <%= @nejaka_data %> | |
<% end %> | |
neco neco <%= @nejaka_jina_data %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment