Skip to content

Instantly share code, notes, and snippets.

@edivandecastro
Created March 11, 2015 18:20
Show Gist options
  • Save edivandecastro/fedadbcf1319a0038aef to your computer and use it in GitHub Desktop.
Save edivandecastro/fedadbcf1319a0038aef to your computer and use it in GitHub Desktop.
<%= form_for(@ambiente, :html => {:class => "form-horizontal"}) do |f| %>
<% if @ambiente.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@ambiente.errors.count, "error") %> prohibited this ambiente from being saved:</h2>
<ul>
<% @ambiente.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<%= form_tag('', id: "ambiente") do -%>
<div class="form-group">
<%= f.label :nome, "Nome:", class: "col-sm-2 control-label" %>
<div class="col-sm-2">
<%= f.text_field :nome, class: "form-control"%>
</div>
</div>
<div class="field">
<%= f.hidden_field :orcamento_id, :value => @orcamento.id, {:id => "ambiente-id-orcamento"}%>
</div>
<% end %>
<div class="col-sm-2">
<br><br/>
<%= submit_tag "Adicionar Ambiente", :id=>"adicionar-ambiente", :class =>"btn btn-sucess" %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment