B
Bill Mccarthy
Hey everyone...trying to get a handle on Ruby syntax but having a bit of
an issue.
I am trying to create a form and then call a linux system call that will
create a directory using the value of the variable within the fieldset.
Here is a short example:
<fieldset>
<ol>
<li>
<%= f.label :name %>
<%= f.text_field :name, :class => 'text' %>
</li>
<li>
<%= f.label :credit_balance %>
<%= f.text_field :credit_balance, :class => 'text' %>
</li>
</ol>
</fieldset>
<fieldset class="submit">
<%= f.submit 'Submit', :class => 'submit' %>
</fieldset>
<% system("mkdir /var/www/html/WHAT DO I PUT HERE") %>
Basically, I just need to know the syntax of the system line so that the
directory that will be created will be the value of the :name variable
within the fieldset but cannot figure out the syntax. In other words,
if, on the form someone puts in WHATEVER for the :name field and 10 for
the :credit_balance, I want to create a directory called
/var/www/html/WHATEVER
Easy for me in PHP, but I have not been able to find a way to do it in
Ruby. I am sure that it is easy for one of you.
If someone would be nice enough to get me started in the right
direction, I would really appreciate it.
Thank so much!
an issue.
I am trying to create a form and then call a linux system call that will
create a directory using the value of the variable within the fieldset.
Here is a short example:
<fieldset>
<ol>
<li>
<%= f.label :name %>
<%= f.text_field :name, :class => 'text' %>
</li>
<li>
<%= f.label :credit_balance %>
<%= f.text_field :credit_balance, :class => 'text' %>
</li>
</ol>
</fieldset>
<fieldset class="submit">
<%= f.submit 'Submit', :class => 'submit' %>
</fieldset>
<% system("mkdir /var/www/html/WHAT DO I PUT HERE") %>
Basically, I just need to know the syntax of the system line so that the
directory that will be created will be the value of the :name variable
within the fieldset but cannot figure out the syntax. In other words,
if, on the form someone puts in WHATEVER for the :name field and 10 for
the :credit_balance, I want to create a directory called
/var/www/html/WHATEVER
Easy for me in PHP, but I have not been able to find a way to do it in
Ruby. I am sure that it is easy for one of you.
If someone would be nice enough to get me started in the right
direction, I would really appreciate it.
Thank so much!