Project

General

Profile

Actions

Bug #699

closed

Foreman Template Parser bug

Added by Arnaud Sourioux about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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))

Actions #1

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}" %>

Actions #2

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

Actions #3

Updated by Ohad Levy about 13 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF