阅读背景:

如何使用可选属性来选择文章?

来源:互联网 
#routes.rb
get "/:year(/:month(/:day))(/:genre)" => "archives#index", :constraints => { :year => /\d{4}/, :month => /\d{2}/, :day => /\d{2}/ }

#archives_controller.rb
def index
@articles = Article.all(params[:year, :month, :day, :genre],:order => "created_at DESC")
#routes.rb
get "/:year(/:month(/:day))(/:genre)



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: