Open wbotelhos opened 8 years ago
When I submit:
post :create, exam: { name: 'name', description: nil }
And validation fails because description is mandatory:
description
if @exam.save else render :new end
The @exam object does not keeps the submited value.
@exam
<%= f.text_field :name %> # nil
I need to manually set the acting_as data:
acting_as
@exam.attributes = create_params
Even the errors:
@exam.acting_as.errors.each do |key, value| @exam.errors.add key, value end
Uses delegate on model does not works for the attributes and I do not found a way to delegate the errors.
delegate
errors
I missing something here or it is the normal behavior?
Thanks e congrats for the great gem. (:
Hi @wbotelhos, could you write a test or a sample app that recreates this problem? It's hard to follow without seeing your custom models and controllers.
When I submit:
And validation fails because
description
is mandatory:The
@exam
object does not keeps the submited value.I need to manually set the
acting_as
data:Even the errors:
Uses
delegate
on model does not works for the attributes and I do not found a way to delegate theerrors
.I missing something here or it is the normal behavior?
Thanks e congrats for the great gem. (: