2010-02-06 53 views

回答

2

类似:

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

的to_i可能是在年底Time.now.month有点多余,但它会消除的if/else逻辑

相关问题