Bug #699
closedForeman Template Parser bug
Description
It seem's like the Template parser has a problem when i try to do things such as :
<%= first_var(<%= second_var %>) %>
(for example first_var could be "foreman url")
the parser detect this :
<%= first_var(<%= second_var %> as a foreman variable (and then it gives me a parser error)
instead of <%= second_var %>
included in <%= first_var("second_var_result") %>
It is like a maths parser
if I have ($a + ($c + $b))
I should find ($c + $b) included in ($a + ($result_of_c+b))
Updated by Ohad Levy about 13 years ago
- Status changed from New to Feedback
arnaud sourioux wrote:
It seem's like the Template parser has a problem when i try to do things such as :
<%= first_var(<%= second_var %>) %>
since the templates are ruby (ERB stands for Embedded Ruby), you need to follow the ruby syntax for that:
if they are strings then you can do:
<%= "#{first_var} #{second_var}" %>
if its dynamic methods you might need to
<%= eval "#{first_var} #{second_var}" %>
Updated by Arnaud Sourioux about 13 years ago
it's okay for me
i'am sorry first time i work on ruby files ;)
thank you