This file contains 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
def br_titleize(word) | |
humanize(underscore(word)).gsub(/(?!(?<= )(de|da|do|das|dos|d'|e|a|o)\b)(\b[a-z\u00E0-\u00FC])/) { |s| s.mb_chars.capitalize.to_s } | |
end |
This file contains 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
def flash_message | |
types = { :notice => 'info', :success => 'success', :error => 'error', :alert => 'error' } | |
flash.inject("") do |sum, message| | |
content_tag :div, :class => "alert alert-#{types[message[0]]}" do | |
button_tag('×'.html_safe, :type => 'button', :class => 'close', :'data-dismiss' => 'alert', :name => nil) + | |
message[1] | |
end | |
end | |
end |
NewerOlder