2014-03-01 45 views
0

創建我有一組圖像,吾人選擇的單個圖像,並使用形式路線錯誤PDF使用蝦

<%= form_for(:img, method: "post", url: {action: "printer"}) do |f| %> 
    <input type="hidden" id="image_attach" name="image_attach"> 
<%= f.submit "Print" %> 
<%end%> 

接着在我的控制器我有這

它的SRC傳遞給隱藏字段
def printer 
@image_file=params[:image_attach] 
redirect_to(:action => "printing.pdf") 
end 

def printing 
end 

在我看來,我有一個print.pdf.prawn文件,它不打開。

出於某種原因,我不重定向到PDF文件

我收到以下錯誤

enter image description here

我的routes.rb文件

Watermark::Application.routes.draw do 
    root "posts#index" 
    post ':controller(/:action(/:id(.:format)))' 
    get ':controller(/:action(/:id(.:format)))' 
end 

回答

0

redirect_to(:action => "printing.pdf")

應該是

redirect_to(:action => "printing")