templus_models 1.2.8 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/mensagens_helper.rb +1 -1
- data/app/views/crud/_form.html.erb +5 -3
- data/app/views/crud/mensagens/_avisos.html.erb +1 -1
- data/lib/templus_models/version.rb +1 -1
- data/test/dummy/app/models/teste1.rb +1 -1
- data/test/dummy/app/raro_crud/teste1_crud.rb +2 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e5413045e53b19661f659bebb9b87f050a12dd
|
4
|
+
data.tar.gz: 91595263113973c97aca2ec486e76cda7d6d3be6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0edadf0231626d5bfeeb3ce0c2eb45c4753d85c6fdd7f1915c9f7853f10eb6255ac9868fcc29d51a8b3ab049d5595744e0e4c845290c3cd6d40b32ce8b142c34
|
7
|
+
data.tar.gz: 6b28f98a08d8da8b056b2c0117e6632fec359a30c1d6387ce9c61dca601fff50a413c4764217c8abf74f74783e4f6fc781cd68a11694f9c480a40917c5cb2993
|
@@ -9,7 +9,7 @@ module MensagensHelper
|
|
9
9
|
def flash_messages
|
10
10
|
message, tipo = extrair_mensagem
|
11
11
|
if message.present? && tipo.present?
|
12
|
-
render "/crud/mensagens/avisos", tipo: tipo, mensagem:
|
12
|
+
render "/crud/mensagens/avisos", tipo: tipo, mensagem: message
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -30,10 +30,12 @@
|
|
30
30
|
<% end %>
|
31
31
|
<%@crud_helper.form_groups.each do |key, groups|%>
|
32
32
|
<% modelo = @model.reflect_on_association(key.to_s).class_name.constantize %>
|
33
|
-
<% if
|
34
|
-
<% @
|
35
|
-
|
33
|
+
<% if @record.present? && !@record.send(key).present? %>
|
34
|
+
<% if [:has_many,:has_and_belongs_to_many].include?(@model.reflect_on_association(key).macro) %>
|
35
|
+
<% @record.send(key).build %>
|
36
|
+
<% else %>
|
36
37
|
<% @record.send("build_#{key}") %>
|
38
|
+
<% end %>
|
37
39
|
<% end %>
|
38
40
|
<%= f.simple_fields_for key do |g| %>
|
39
41
|
<div class="col-sm-12">
|
@@ -8,9 +8,11 @@ class Teste1Crud < RaroCrud
|
|
8
8
|
campo_tabela :descricao, label: "Descrição"
|
9
9
|
campo_tabela :teste, label: "Nome", sort_field: :teste_nome
|
10
10
|
|
11
|
+
campo_formulario :descricao, label: "Descrição"
|
11
12
|
grupo_formulario :teste, [
|
12
13
|
{campo: :nome, label: "Nome"}
|
13
14
|
]
|
15
|
+
|
14
16
|
campo_visualizacao :descricao, label: "Descrição"
|
15
17
|
campo_visualizacao :teste, label: "Teste"
|
16
18
|
|
Binary file
|