Project

General

Profile

Actions

Bug #23796

closed

template param of @host.param_true? causes render error on 1.14+

Added by Jeff Sparrow almost 6 years ago. Updated almost 6 years ago.

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

Description

According to both the help page on templates and the template writing guide: https://projects.theforeman.org/projects/foreman/wiki/TemplateWriting#Host-or-host-group-parameters
the follow syntax should work in templates:

@host.param_true?('parameter_name')
@host.param_false?('parameter_name')

However, the use of param_true? throws an exception error:

Warning! There was an error rendering the Community Preseed default template: undefined method `param_true?' for # Did you mean? parameters_url

Changing the syntax back to old style host_param_true?('parameter_name') resolves the issue and allows the template to render.

Actions #1

Updated by Marek Hulán almost 6 years ago

  • Status changed from New to Resolved

There's a bug in the documentation, it should have said in 1.14 and earlier. In 1.15 and higher, you should use

host_param_true?('parameter_name')

I've updated the wiki and closing this as resolved. Please reopen if I misunderstood the request.

Actions

Also available in: Atom PDF