請服用:
helper = ActionView::Base.new "app/views"
# (Optional) include this if your partial uses route helpers:
include Rails.application.routes.url_helpers
helper.render :template => "path/to/your/template"
helper.render :partial => 'tags/tag', :collection => Tag.limit(3)
參考來源
沒有留言:
張貼留言