I've got it : 

Compteur <%= compteur %>
> *<% compteur = compteur.to_i  -%>*
> <% compteur += 1 -%>
> Compteur <%= compteur %>
>


Le mardi 24 avril 2012 15:38:28 UTC+2, AnOnJoe a écrit :
>
> Hi',
>
> I'm looking for a way to increment variable in template (erb file).
>
> I tried this, but it didn't work
>
> Compteur <%= compteur %>
>> <% compteur = compteur + 1 %>
>> Compteur <%= compteur %>
>>
>
> I've got this error : 
>
>> Error 400 on SERVER: Failed to parse template test/test.erb: undefined 
>> method `+' for nil:NilClass
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/7uZXvneHYQkJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to