Prawn missing template
I've installed the prawn
gem in my application.
gem 'prawn', :git => "git://github.com/sandal/prawn.git", :tag => '0.10.2', :submodules => true
Added the pdf
format to the controller on show
method.
def show
@order = Order.find(params[:id])
respond_to do |format|
format.html
format.pdf { render :la开发者_如何学Goyout => false}
end
end
And created the show.pdf.prawn
template file in my views/order
directory.
show.pdf.prawn:
pdf.text "Hello World"
But when I try to load something like /order/2.pdf
I get a missing template page.
What could I do to fix that?
Just missed to install the prawnto
plugin:
rails plugin install git://github.com/thorny-sun/prawnto.git
Now it works!
精彩评论