On Saturday 15 April 2006 22:34, Craig W. wrote:
I’m lost on regular expressions to begin with…
I’m trying to fix a value to one of 4 radio buttons as there will be
value of either 1,2,3 or 4 in @roles_users…
So @roles_users is an integer, or a string ? I assume an integer…
<%= “checked” if @roles_users == 1 %>
Note that the ‘if’ must have a corresponding ‘end’. The one line form of
has a mandatory ‘then’ too:
if @roles_users == 1 then “checked” end … is the verbose equivalent of
The syntax for a regular expression is @roles_users =~ /1/
value="Case Manager None"
<% if =~ @roles_users /4/ checked = "checked" %> /></TD>
but this code gets me a syntax error…
@roles_users is a hash created from a find.
Hmm… so it’s not an integer / string like I understood from the
What’s the contents of your hash?