This commit is contained in:
f 2020-01-22 17:38:22 -03:00
parent 14efee286f
commit 597daceb5b
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
# Un campo de correo
# TODO: Validar que tenga un formato correo
class MetadataString < MetadataTemplate
# Una string vacía
def default_value
''
end
def value
super.strip
end
end

View file

@ -0,0 +1,4 @@
%tr{ id: attribute }
%th= post_label_t(attribute, post: post)
%td
%a{ href: "mailto:#{metadata.value}" }= metadata.value

View file

@ -0,0 +1,6 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= email_field 'post', attribute, value: metadata.value,
**field_options(attribute, metadata)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata