Skip to content

Instantly share code, notes, and snippets.

@KattyaCuevas
Last active August 29, 2015 14:04
Show Gist options
  • Save KattyaCuevas/6ef254700b8ecb30b50d to your computer and use it in GitHub Desktop.
Save KattyaCuevas/6ef254700b8ecb30b50d to your computer and use it in GitHub Desktop.
Forms en Rails
<%= form_tag do %>
<!-- <label for="nombre">Nombre:</label> -->
<%= label_tag(:nombre, "Nombre:") %>
<!-- <input id="nombre" name="nombre" type="text"> -->
<%= text_field_tag(:nombre) %>
<br />
<%= label_tag(:descripcion, "Descripcion General") %>
<!-- <input id="nombre" name="nombre" type="text"> -->
<%= hidden_field_tag(:descripcion, "Es un producto") %>
<br />
<!-- <select id="precio" name="precio">
<option value="1">50.00</option>
<option selected="selected" value="2">100.00</option>
</select> -->
<%= select_tag(:precio, options_for_select([
['50.00',1],
['100.00',2],
], 2)) %>
<br />
<!-- <input name="commit" type="submit" value="Crear"> -->
<%= submit_tag("Crear") %>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment