You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to destroy country with cities inside irb:
irb(main):001:0> c=Country.firstirb(main):002:0> c.destroy(1.0ms)ROLLBACKirb(main):003:0> c.errors.messages=>{:base=>["Cannot delete record because dependent cities exist"]}
If we try to delete the country via rails_admin we only got an abstract message: Country failed to be deleted
Rails_admin should use full error message because an admin have to know what is wrong.
The text was updated successfully, but these errors were encountered:
I wanted to make a PR, but there is one more issue. For example, create action does not use redirect when there are any exceptions and so callshandle_save_errormethod with flash.now. Delete with errors redirects so it uses just flash message. But iterating over flash messages in view escapes html and you can not just do something like this:
but I don't think it's a good idea.
Does anyone have any suggestions?
airled
changed the title
Message for 'dependent: :restrict_with_error'
[Enhacement] Message for 'dependent: :restrict_with_error'
Nov 20, 2019
airled
changed the title
[Enhacement] Message for 'dependent: :restrict_with_error'
[Enhancement] Message for 'dependent: :restrict_with_error'
Dec 25, 2019
I second my support for this update. And I would generalize it to allow more broadly for displaying all model errors, not just for dependent: :restrict_with_error.
Rails_admin ignores Rails message with key
restrict_dependent_destroy
(See this)Example:
Country
model:If you try to destroy country with cities inside irb:
If we try to delete the country via rails_admin we only got an abstract message:
Country failed to be deleted
Rails_admin should use full error message because an admin have to know what is wrong.
The text was updated successfully, but these errors were encountered: