mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 01:31:42 +00:00
la opción required tiene más prioridad que la definición closes #217
This commit is contained in:
parent
12756e3d6a
commit
360b999dcb
2 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ module ApplicationHelper
|
|||
|
||||
# Opciones por defecto para el campo de un formulario
|
||||
def field_options(attribute, metadata, **extra)
|
||||
required = metadata.required || extra[:required]
|
||||
required = extra.key?(:required) ? extra[:required] : metadata.required
|
||||
|
||||
{
|
||||
class: "form-control #{invalid(metadata.post, attribute)} #{extra[:class]}",
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
= text_field(*field_name_for(base, attribute, :description),
|
||||
value: metadata.value['description'],
|
||||
dir: dir, lang: locale,
|
||||
**field_options(attribute, metadata))
|
||||
**field_options(attribute, metadata, required: false))
|
||||
= render 'posts/attribute_feedback',
|
||||
post: post, attribute: [attribute, :description], metadata: metadata
|
||||
|
||||
|
|
Loading…
Reference in a new issue