Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object does not keeps the attributes submited #74

Open
wbotelhos opened this issue Apr 18, 2016 · 1 comment
Open

Object does not keeps the attributes submited #74

wbotelhos opened this issue Apr 18, 2016 · 1 comment

Comments

@wbotelhos
Copy link

When I submit:

post :create, exam: { name: 'name', description: nil }

And validation fails because description is mandatory:

if @exam.save
else
  render :new
end

The @exam object does not keeps the submited value.

<%= f.text_field :name %> # nil

I need to manually set the acting_as data:

@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.

I missing something here or it is the normal behavior?

Thanks e congrats for the great gem. (:

@manuelmeurer
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants