There is a code in my Sinatra app
- if flash[:error]
.alert.alert-error
%button.close{:type =>" button", "data-dismiss"=>"alert"}x
= flash[:error]
- if flash[:warning]
.alert.alert-warning
%button.close{:type =>" button", "data-dismiss"=>"alert"}x
= flash[:warning]
- if flash[:info]
.alert.alert-info
%button.close{:type =>" button", "data-dismiss"=>"alert"}x
= flash[:info]
Is there any way to simply it? In particular, is there any way to get rid of repeating :type =>" button", "data-dismiss"=>"alert" hash initialisations by storing them as a variable?
Try something like: