开发者

Prawn missing template

开发者 https://www.devze.com 2023-03-29 18:38 出处:网络
I\'ve installed the prawn gem in my application. gem \'prawn\', :git => \"git://github.com/sandal/prawn.git\", :tag => \'0.10.2\', :submodules => true

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

精彩评论

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