2014-05-22から1日間の記事一覧
「Hash Selector Pattern」を読んだ。 if / elseやcase / switchよりもHashを使用したほうが可読性が上がるよねという事例が紹介されている。 # if / elseの場合 if flash[:type] == :success 'alert-success' elsif flash[:type] == :error 'alert-danger' …
「Hash Selector Pattern」を読んだ。 if / elseやcase / switchよりもHashを使用したほうが可読性が上がるよねという事例が紹介されている。 # if / elseの場合 if flash[:type] == :success 'alert-success' elsif flash[:type] == :error 'alert-danger' …