Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Agendador
Agendador
Commits
833ff1ae
Commit
833ff1ae
authored
Jun 22, 2017
by
Pedro Henrique
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hotfix erro 500 when creating city hall and service place
Signed-off-by:
Pedro Henrique!
<
pha14@inf.ufpr.br
>
parent
59a8ddcd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
20 deletions
+44
-20
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+1
-1
app/views/city_halls/_form.html.erb
app/views/city_halls/_form.html.erb
+25
-13
app/views/service_places/_form.html.erb
app/views/service_places/_form.html.erb
+18
-6
No files found.
app/assets/stylesheets/common.scss
View file @
833ff1ae
...
...
@@ -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
;
}
...
...
app/views/city_halls/_form.html.erb
View file @
833ff1ae
...
...
@@ -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
/>
...
...
app/views/service_places/_form.html.erb
View file @
833ff1ae
...
...
@@ -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"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment