开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜