igor-alexandrov/wisepdf

Template is missing

mairon opened this issue · 7 comments

hi, Igor,

my controller

def relatorio_financas
@financas = Financa.relatorio_financas(params)
@financas_anterior = Financa.relatorio_financas_saldo_anterior(params)
respond_to do |format|
format.html
format.pdf { render :pdf => "relatorio_financas" }
end
end

error
Template is missing

Missing template financas/relatorio_financas with {:locale=>[:en], :formats=>[:pdf], :handlers=>[:erb, :builder]}. Searched in: * "/home/mairon/projetos/zetta/app/views"

because he shall not find the format?

Can you show me contents of /home/mairon/projetos/zetta/app/views/financas/relatorio_financas, please?

Igor Alexandrov
–––––––––––––––––––––––––––––––––––––––
+7 (910) 531-6049
igor.alexandrov@gmail.com
skype: alexandrov-igor
–––––––––––––––––––––––––––––––––––––––

On Tuesday, November 27, 2012 at 8:27 PM, MaironBrasil wrote:

hi, Igor,
my controller
def relatorio_financas

@financas = Financa.relatorio_financas(params)
@financas_anterior = Financa.relatorio_financas_saldo_anterior(params)
respond_to do |format|
format.html
format.pdf { render :pdf => "relatorio_financas" }
end
end
error
Template is missing
Missing template financas/relatorio_financas with {:locale=>[:en], :formats=>[:pdf], :handlers=>[:erb, :builder]}. Searched in: * "/home/mairon/projetos/zetta/app/views"
because he shall not find the format?


Reply to this email directly or view it on GitHub (#14).

is simple content

<% if params[:moeda].to_s == '1'%> <% else %> <% end %>
Anterior : <%= number_to_currency(anterior, :format=>' %n ', :precision => 0)%> <%= number_to_currency(subentrada, :format=>' %n ', :precision => 0) %> <%= number_to_currency(subsaida, :format=>' %n ', :precision => 0) %> <%= number_to_currency(anterior.to_f + subentrada.to_f - subsaida.to_f , :format=>' %n ', :precision => 0) %>Anterior : <%= number_to_currency(anterior, :format=>' %n ', :separeitor => ',')%> <%= number_to_currency(subentrada, :format=>' %n ', :separeitor => ',') %> <%= number_to_currency(subsaida, :format=>' %n ', :separeitor => ',') %> <%= number_to_currency(anterior.to_f + subentrada.to_f - subsaida.to_f , :format=>' %n ', :separeitor => ',') %>

I mean content of a directory. Like:

cd  /home/mairon/projetos/zetta/app/views/financas/relatorio_financas
ls -la

cd /home/mairon/projetos/zetta/app/views/financas

drwxr-xr-x 2 mairon mairon 4096 Nov 28 17:48 .
drwxr-xr-x 80 mairon mairon 4096 Nov 27 12:15 ..
-rwxr-xr-x 1 mairon mairon 209 Set 20 2010 edit.html.erb
-rw-r--r-- 1 mairon mairon 3026 Nov 27 12:19 extrato_bancario.html.erb
-rwxr-xr-x 1 mairon mairon 2105 Nov 27 12:19 index.html.erb
-rw-r--r-- 1 mairon mairon 3312 Nov 14 12:13 _lanz_futuros_extrac_bc.html.erb
-rwxr-xr-x 1 mairon mairon 171 Set 20 2010 new.html.erb
-rwxr-xr-x 1 mairon mairon 6567 Nov 28 17:28 relatorio_financas.html.erb

To create PDFs you should add relatorio_financas.pdf.erb, or use one template for both html and pdf, then you should remove html part from template name: relatorio_financas.erb.

Perfect.. Thanks