Displaying 20 results from an estimated 300 matches similar to: "How to increment variable in erb template ?"
2012 Nov 28
2
[hiera] Hierarchy modification takes long time to be effective
Hello,
I''ve something strange :
When I modify my hierarchy in my hiera.yaml, it can take up to several
hours, for the modification to work.
eg : I create a subdir in my hieradata, move all the concerned files into,
modify my hiera.yaml
> from :
> :hierarchy:
> - %{operatingsystem}
>
to :
> :hierarchy:
> - *os/*%{operatingsystem}
>
but the changes
2006 Jul 25
3
about ERB sample
Hi list:
I run the ri''s ERB doc 1st sample
1. require ''erb''
2. x = 42
3. template = ERB.new <<-EOF
4. The value of x is:
5. EOF
6. puts template.result(binding)
the doc say it will print
"The value of x is: 42"
but my irb print "nil" and there is a
"=> #<ERB:0x2970b24
2012 Sep 03
2
erb syntaxes
Hi guys,
I''m trying to do the following in my template:
location <%= location %> {
proxy_pass <%= proxy %>;
<% if scope.lookupvar(''nginx::resource::location::proxy_header'') then
scope.lookupvar(''nginx::resource::location::proxy_header'').each do
|header| %>
proxy_set_header <%= header %>
<% end
2006 Feb 07
3
Newbie help ..
Hi ..
I am new to Rails and it is not clear to me why I am getting the
following error. Any help appreciated.
-m.
$cat app/views/admin/new.rhtml
<% @page_title = "New member..." -%>
<%= start_form_tag( :action => ''create'' ) %>
<table>
<tr>
<td> First Name: </td>
<td> <%= text_field(
2006 Sep 11
2
Compilation Errors
Hey there,
I just updated to ferret 10.0.4, and acts_as_ferret 0.3, and now when I
try to run my app with mongrel on Windows, I get very strange compile
errors:
ompile error
C:/rails/app/script/../config/../app/views/login/index.rhtml:8: Invalid
char `\002'' in expression
C:/rails/app/script/../config/../app/views/login/index.rhtml:9: syntax
error
_erbout.concat "
2006 Jan 10
7
All My Rails Apps Died Over the Holidays
I have several Rails (version 1.0) apps I''m working on on a Win XP box
using Webrick that were working fine before I left for the holidays. I
came back, started up and they all get the same syntax and compile
errors:
compile error
./script/../config/../app/views/time/list.rhtml:4: Invalid char `\212''
in expression
repeated over and over. Refreshing the page gives thes same
2006 Jan 26
42
ruby script/generate scaffold Product Admin hangs
Hi
I am running Mac OX tiger with the installed ruby 1.8.2, and
mysql5 (I checked that it was running in preference). I
tried to run the various fixes recommended in agileweb. I am
stuck on page 57, script/generate scaffold...
> Could you paste in your database.yml file, from the
> "config" folder inside your Rails app? If you have any
> passwords entered there, you should
2006 Jan 19
9
start_form_tag not taking url_for options
I''ve got a form that should post to user/login. The code to start the tag is:
<%= start_form_tag { :controller => "user", :action => "login" } %>
That gives me this exception:
compile error
script/../config/../app/views/user/login.rhtml:1: parse error,
unexpected tASSOC, expecting ''}''
_erbout = ''''; _erbout.concat((
2006 Apr 08
5
Strange error ...
I''m getting a very strange error in a very vanilla Rails app setup:
compile error
./script/../config/../app/views/home/index.rhtml:1: parse error,
unexpected $, expecting kEND
_erbout = ''''; _erbout.concat " <div id=\"index_main\">\n"
... ?
Anyone know what this might be? I installed the Login Engine and the
error started. I''m using
2015 Feb 19
4
Masquerading (packet forwarding) on CentOS 7
Hi,
I just migrated my office's server from Slackware64 14.1 to CentOS 7. So
far everything's running fine, I just have a few minor details to work out.
I removed the firewalld package and replaced it by a simple Iptables script:
--8<----------------------------------------------------
#!/bin/sh
#
# firewall-lan.sh
IPT=$(which iptables)
MOD=$(which modprobe)
SYS=$(which sysctl)
2007 May 28
2
helper with block compile error
HI,
i''m trying to write a helper that replaces link_to_remote that
accepts a block but it gets a compile error in the template:
I don''t know what I''m doing wrong... TIA
# application_helper.rb
def link_block_to_remote( options = {}, html_options = {}, &block)
concat(link_to_remote(capture(&block), options, html_options),
block.binding)
end
# in
2011 Jun 17
0
.js.erb not being parsed by .erb first
I am trying to dynamically include a javascript file based on a
configuration option however I keep getting this error:
Error compiling asset application.js:
ArgumentError: wrong number of arguments (3 for 1)
(in c:/Users/Dieter/Documents/event_calendar/vendor/assets/javascripts/event_calendar.js.erb:1)
when trying to run this code:
//<% require ''event_calendar'' %>
//=
2011 Nov 18
2
Are tildes actually valid in templates or is this a bug?
Hi all,
First off, we''re running Puppet 2.7.6 with Ruby 1.8.7 on CentOS 6.0.
Now, I''m using tildes in a template to prevent newlines from appearing but
ruby/puppet is choking on them.
*/tmp/puppet$ cat test.erb*
Line 1: Line 2 will exist if running on CentOS.
<% if operatingsystem == "CentOS" ~%>
Line 2: Yay, we''re running CentOS.
<% end ~%>
2006 May 31
7
How to render from with <%%> ?
I have a loop that I iterate through in my view.
<%
coll.each do |itm|
puts(itm.value)
end
%>
How do I render the itm.value without using a <%= %> tag? Should puts
not work?
Joerg
P.S. There is a good enough reason for me wanting to do this :-)
--
Posted via http://www.ruby-forum.com/.
2007 Feb 12
1
Invalid char problem
Has the problem with corrupted .rhtmls (invalid characters) been solved
so far?
I would like to use ferret and acts_as_ferret on Windows XP. I have
installed 0.10.9 (mswin32) which still seems to have the problem.
I am receiving error messages like:
compile error
C:/INSTAN~1.4P1/INSTAN~1/rails_apps/travelogue/config/../app/views/article_editor/_header_read.rhtml:2:
parse error, unexpected
2006 Feb 20
7
Native erb lacks -%>, where is Rails'' erb?
Native ERB in ruby, and eruby, seem to lack the -%> feature for
suppressing trailing newlines. Thus
erb -n script
gives errors. Where is Rails ERB so I can invoke it directly?
Thank you
Hugh
2006 Apr 05
25
How to avoid bunch of <% %> ??
Hello, I would like to know is there is a way to avoid poluting the
views with tons of <% %> ?
Like this
<%= start_form_tag() %>
<%= text_field_tag(''category[title]'', category.title, {:size => 20,
:maxlength => 128}) %>
<% if not category.parent_id.nil? %>
<%= select("category", "parent_id",
Category.find(:all,
2011 Aug 08
12
Hash Interpolation inside double quotes?
I''ve got this:
file {
''/opt/sugarsync/tomcat/tomcat-home/current'':
ensure => "tomcat-$config[''tomcat_version_server'']";
where $config[''tomcat_version_server''] was set with extlookup (the yaml
one), by loading:
---
tomcat_config:
tomcat_version_server: 6.0.20-1
tomcat_version_libs: 1.0-1
2012 Jan 23
13
Template Help Please
Hello,
I am trying to setup a template with data being passed in as a long
string of data which is being returned via extlookup()
i.e. $resolvers = "10.10.10.10 11.11.11.11.12.12.12.12"
The template should split those up and put a nameserver entry per line
in /etc/resolv.conf
I have this in the template now:-
<%=
2006 Jul 20
3
Output to browser in .rhtml templates
Hi!
In .rhtml template I''m trying to create some output, which should be
sent to browser. But this is inside <% %> not <%= %>, so how can it be
accomplished? Default output is directed to log file, so puts "output"
does not send to browser but to log file...
--
Posted via http://www.ruby-forum.com/.