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

#create failing silently when a embedded_attribute validation fails #1086

Closed
wemcdonald opened this issue Feb 29, 2012 · 5 comments
Closed

Comments

@wemcdonald
Copy link

create fails silently if an embedded has_one object has a validation error.

class Question < ActiveRecord::Base
  has_one :answer
  accepts_nested_attributes_for :answer
end
class Answer < ActiveRecord::Base
  belongs_to :question
  validates :text, :inclusion => %w{42 no}
end

POST to /activeadmin/questions:

Processing by Activeadmin::QuestionsController#create as HTML
Parameters: {"question"=>{"answer_attributes"=>{"text"=>"yes"}}, "commit"=>"Create Question"}

What I see

AA redirects to ActiveAdmin::QuestionsController#new and logs no errors

What I expect to see

A validation error

@drush
Copy link

drush commented Apr 10, 2012

+1

1 similar comment
@netpenthe
Copy link

+1

@jpmckinney
Copy link
Contributor

AA should really just render errors on :base to fix issues like this one.

@jpmckinney
Copy link
Contributor

See #905

@jpmckinney
Copy link
Contributor

Marking as dupe of #905

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

4 participants