RailsCasts Pro episodes are now free!
Learn more or hide this
Resource
expose(:articles) { Article.order(:name) } expose(:article) # or without decent_exposure def articles @articles ||= Article.order(:name) end helper_method :articles def article @article ||= params[:id] ? Article.find(params[:id]) : Article.new(params[:article]) end helper_method :article
expose(:article) expose(:comments) { article.comments } expose(:comment)