Problems using plugin with .rfpdf-templates

2 views
Skip to first unread message

tisp

unread,
Apr 30, 2007, 8:52:50 AM4/30/07
to Ruby on Rails: RFPDF
Hi there,

I tried to generate PDFs with .rfpdf-templates. It seems to work, but
now my application is always sending a pdf, even when I want a simple
HTMl page.

Here's what I did:

1. Installed plugin
2. created a template: index.rfpdf in my view folder
3. here's what my base controller looks like:

def index
@clients = sort(@clients.find(:all, :order => 'lastname'))
respond_to do |format|
format.html
format.xml { render :xml => @clients.to_xml }
end
end

When accessing localhost:3000/clients my browser always want to
download an pdf. In my opinion this should still access the simple
html output (there even is NO word about generating a PDF in the
controller... really weird).

Regards,
tisp

Ed Moss

unread,
May 22, 2007, 12:09:48 AM5/22/07
to Ruby on Rails: RFPDF

My guess is, Rails is looking to display index.* when no action is
specified or the default view is identified. It looks for an index.*
with a view extension it recognizes. In this case that would be
a .rhtml or a .rfpdf.

Naming a file index.rfpdf is causing the confusion. It would probably
be best to name it something else.

Reply all
Reply to author
Forward
0 new messages