2010-02-06 50 views

回答

2

類似:

@selected_month = (params[:month] || Time.now.month).to_i 

的to_i可能是在年底Time.now.month有點多餘,但它會消除的if/else邏輯

相關問題