sorry i forget to copy that :
validates_presence_of :portrait,
:pied
Le jeudi 24 décembre 2015 13:42:06 UTC+1, Sergio Cambra a écrit :
>
> I don't see why it's adding required to file input fields, there is no
> validates_presence_of for them
>
> El Jueves, 24 de diciembre de 2015 04:26:46 Gloufy escribió:
> > validates_property :format, of: :portrait, in: ['jpeg','jpg', 'png',
> > 'gif'],message: "Le format de la photo portrait doit être : .jpeg, .jpg,
> > .png, .gif",:on =>
> > :create
> >
> > validates_property :format, of: :pied, in: ['jpeg','jpg', 'png',
> > 'gif'],message: "Le format de la photo pied doit être : .jpeg, .jpg,
> .png,
> > .gif",:on =>
> > :create
> >
> > validate do
> >
> >
> >
> > errors.add(:portrait, "Il faut une photo portrait") if self
> > .portrait.blank?
> >
> > errors.add(:pied, "Il faut une photo en pied") if self.pied.blank?
> >
> >
> > end
> >
> > Le jeudi 24 décembre 2015 13:03:16 UTC+1, Sergio Cambra a écrit :
> > > What are validations on your model?
> > >
> > > El Jueves, 24 de diciembre de 2015 03:40:07 Gloufy escribió:
> > > > exactly ! no errors on loading form just when i'm clicking on update
> > >
> > > button,
> > >
> > > > in tab inspector i didn't find a request for a submit, without click
> > >
> > > update
> > >
> > > > button and click update button.
> > > > but if i put this on the helper it's work :
> > > >
> > > > def active_scaffold_input_options(column, scope = nil, options = {})
> > > >
> > > > opts = super
> > > >
> > > > if (column.name.to_s=="portrait" and [email protected]?)
> or
> > > >
> > > > (column.name.to_s=="pied" and [email protected]?)
> > > >
> > > > opts.delete(:required)
> > > >
> > > > end
> > > >
> > > > opts
> > > >
> > > > end
> > > >
> > > > Le jeudi 24 décembre 2015 12:25:06 UTC+1, Sergio Cambra a écrit :
> > > > > Re-read and I think not focusable errors are logged when form is
> > >
> > > loaded,
> > >
> > > > > trying to focus first field, not related to submit. Check network
> tab
> > >
> > > in
> > >
> > > > > inspector, is there a request for submit? If not, check fields
> with
> > > > > required
> > > > > attribute.
> > > > >
> > > > > El Jueves, 24 de diciembre de 2015 03:15:05 Gloufy escribió:
> > > > > > Yes ! :
> > > > > > <input value="false" type="hidden"
> name="record[remove_portrait]"
> > > > > > id="record_remove_portrait"> but no required attribute..
> > > > > >
> > > > > > Le mardi 28 juillet 2015 09:21:28 UTC+2, Sergio Cambra a écrit :
> > > > > > > Probably it's a hidden field, which have wrongly required
> > >
> > > attribute.
> > >
> > > > > Can
> > > > >
> > > > > > > you check that with inspector?
> > > > > > >
> > > > > > > El Viernes, 24 de julio de 2015 04:25:35 Gloufy escribió:
> > > > > > > > Hi
> > > > > > > >
> > > > > > > > On update, my form is doesn't send when i don't change the
> > >
> > > dragonfly
> > >
> > > > > > > file.
> > > > > > >
> > > > > > > > In console i have :
> > > > > > > >
> > > > > > > > An invalid form control with name='record[portrait]' is not
> > > > >
> > > > > focusable.
> > > > >
> > > > > > > > edit:1 An invalid form control with name='record[pied]' is
> not
> > > > > > > > focusable.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > What does that mean ?
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Gloufy
>
>
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.