Is there a way in Rails to add a class to the html tag if the current page displayed a 404 error.
On my controller, if a user visits the wrong site, he displays the file in a public error with a 404 error like this
else
render file: 'public/error', status: 404, formats: [:html]
end
I want to add a class to the footer hiddento hide the footer if this page is displayed. I tried this with no luck (but it was more likely an assumption)
<%= "hidden" if current_page?(status: 404) %>
Any suggestions
source
share