2012-09-01から1ヶ月間の記事一覧
def special_or_normal @current_user.special? ? "special" : "normal" end special? がtrueならspecialを返却、そうでなければnormalを返却。 ?で条件分岐して、 : で分割して列挙する。 以下のコードと同じ。 def special_or_normal if(true == @current_…
def special_or_normal @current_user.special? ? "special" : "normal" end special? がtrueならspecialを返却、そうでなければnormalを返却。 ?で条件分岐して、 : で分割して列挙する。 以下のコードと同じ。 def special_or_normal if(true == @current_…