Commit 833ff1ae authored by Pedro Henrique's avatar Pedro Henrique

hotfix erro 500 when creating city hall and service place

Signed-off-by: Pedro Henrique's avatarPedro Henrique! <pha14@inf.ufpr.br>
parent 59a8ddcd
......@@ -470,7 +470,7 @@
#data-nascimento .field-select{
display:inline;
}
#city_state_id, #citizen_city_id{
#city_state_id, #citizen_city_id, #city_hall_city_id {
-moz-appearance: none;
-webkit-appearance: none;
}
......
......@@ -46,31 +46,43 @@
</div>
<div class="col s12 m6 l6">
<div class="field-required">
<%= label_tag :state_id, t(:state)+":" %><br />
<%= collection_select(:city, :state_id, State.all, :id, :name,
{ :selected => @city_hall.city.state.id },
{ :disabled => "disabled" }) %>
<%= f.label :neighborhood, t(:neighborhood)+"*: " %><br />
<%= f.text_field :neighborhood %>
</div>
</div>
<div class="col s12 m6 l6">
<div class="field-required">
<%= hidden_field_tag :cities_list, root_url %>
<%= f.label :city_id, t(:city)+"*: " %>
<p id="city_hall_city_id_loading" style="display: none;"><i>Carregando lista de municípios...</i></p>
<%= collection_select(:city_hall, :city_id, @city_hall.city.state.cities, :id, :name,
{ :selected => @city_hall.city.id },
{ :disabled => "disabled" }) %>
<%= label_tag :state_id, t(:state)+":" %><br />
<% if @city_hall.new_record? %>
<%= collection_select(:city, :state_id, State.all, :id, :name,
{ :include_blank => "Digite um CEP" },
{ :disabled => "disabled" }) %>
<% else %>
<%= collection_select(:city, :state_id, State.all, :id, :name,
{ :selected => @city_hall.city.state.id },
{ :disabled => "disabled" }) %>
<% end %>
</div>
</div>
<div class="col s12 m6 l6">
<div class="field-required">
<%= f.label :neighborhood, t(:neighborhood)+"*: " %><br />
<%= f.text_field :neighborhood %>
<%= hidden_field_tag :cities_list, root_url %>
<%= label_tag :city_id, t(:city)+"*: " %>
<p id="city_hall_city_id_loading" style="display: none;"><i>Carregando lista de municípios...</i></p>
<% if @city_hall.new_record? %>
<%= collection_select(:city_hall, :city_id, Array.new, :id, :name,
{ :include_blank => "Digite um CEP" },
{ :disabled => "disabled" }) %>
<% else %>
<%= collection_select(:city_hall, :city_id, @city_hall.city.state.cities, :id, :name,
{ :selected => @city_hall.city.id },
{ :disabled => "disabled" }) %>
<% end %>
</div>
</div>
<div class="col s12 m6 l6">
<div class="field-required">
<%= f.label :address_street, t(:address_street)+" da sede*: " %><br />
......
......@@ -50,9 +50,15 @@
<div class="col s12 m6 l6">
<div class="field-required">
<%= label_tag :state_id, t(:state)+":" %><br />
<%= collection_select(:city, :state_id, State.all, :id, :name,
{ :selected => @service_place.city.state.id },
{ :disabled => "disabled" }) %>
<% if @service_place.new_record? %>
<%= collection_select(:city, :state_id, State.all, :id, :name,
{ :include_blank => "Digite um CEP" },
{ :disabled => "disabled" }) %>
<% else %>
<%= collection_select(:city, :state_id, State.all, :id, :name,
{ :selected => @service_place.city.state.id },
{ :disabled => "disabled" }) %>
<% end %>
</div>
</div>
<div class="col s12 m6 l6">
......@@ -60,9 +66,15 @@
<%= hidden_field_tag :cities_list, root_url %>
<%= f.label :city_id, t(:city)+"*: " %>
<p id="service_place_city_id_loading" style="display: none;"><i>Carregando lista de municípios...</i></p>
<%= collection_select(:service_place, :city_id, @service_place.city.state.cities, :id, :name,
{ :selected => @service_place.city.id },
{ :disabled => "disabled" }) %>
<% if @service_place.new_record? %>
<%= collection_select(:service_place, :city_id, Array.new, :id, :name,
{ :include_blank => "Digite um CEP" },
{ :disabled => "disabled" }) %>
<% else %>
<%= collection_select(:service_place, :city_id, @service_place.city.state.cities, :id, :name,
{ :selected => @service_place.city.id },
{ :disabled => "disabled" }) %>
<% end %>
</div>
</div>
<div class="col s12 m6 l6">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment