Created
April 30, 2019 14:45
-
-
Save 3h5a9/6dd0c65e290ee505a103a62ad24b3675 to your computer and use it in GitHub Desktop.
How to remove field_with_errors wrapper in Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Add the following line of codes into config/environemnt.rb file*/ | |
| ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
| html_tag.html_safe | |
| end |
Author
@deOliveiraDiego can you please tell me where did u get the error?
Thank you
Hi!
I discovered where was my problem. I didn't restart my server. That's all. But, thanks! 😄
Author
@deOliveiraDiego good job done man.
have a nice day.
Thank you dude!
For anyone who stumbles on this via Google, I'd recommend editing this on your application's configuration object instead of duck-punching the proc on ActionView::Base itself.
That could mean in config/application.rb:
config.action_view.field_error_proc = proc do |html_tag, instance|
html_tag.html_safe
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This don't resolve my problem. I don't know why. Can you help me?