Skip to content

Instantly share code, notes, and snippets.

@yamaaki
Last active September 21, 2015 17:41
Show Gist options
  • Save yamaaki/15e5a9427d882f50de98 to your computer and use it in GitHub Desktop.
Save yamaaki/15e5a9427d882f50de98 to your computer and use it in GitHub Desktop.
module DeviseHelper
def devise_error_messages!
return '' if resource.errors.empty?
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg, class: 'p-toast') }.join
html = <<-HTML
<ul class="hide">#{messages}</ul>
HTML
html.html_safe
end
def member_page?
return controller_path.split('/').first == 'member'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment