Revisions
-
suryart revised this gist
Jun 28, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ module ApplicationHelper def bootstrap_class_for flash_type { success: "alert-success", error: "alert-danger", alert: "alert-warning", notice: "alert-info" }[flash_type] || flash_type.to_s end def flash_messages(opts = {}) -
suryart revised this gist
Nov 11, 2013 . 1 changed file with 1 addition and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,7 @@ module ApplicationHelper def bootstrap_class_for flash_type { success: "alert-success", error: "alert-error", alert: "alert-warning", notice: "alert-info" }[flash_type] || flash_type.to_s end def flash_messages(opts = {}) -
suryart renamed this gist
Nov 11, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
suryart created this gist
Nov 11, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ // layout file <body> <div class="container"> <%= flash_messages %> <%= yield %> </div><!-- /container --> </body> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ module ApplicationHelper def bootstrap_class_for flash_type case flash_type when :success "alert-success" when :error "alert-error" when :alert "alert-warning" when :notice "alert-info" else flash_type.to_s end end def flash_messages(opts = {}) flash.each do |msg_type, message| concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)} fade in") do concat content_tag(:button, 'x', class: "close", data: { dismiss: 'alert' }) concat message end) end nil end end