Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionController::UnknownFormat #22

Closed
bhushangahire opened this issue Jan 13, 2016 · 7 comments
Closed

ActionController::UnknownFormat #22

bhushangahire opened this issue Jan 13, 2016 · 7 comments

Comments

@bhushangahire
Copy link

Installed Gem and created pdf.prawn view. When I am accessing url with .pdf. Its giving me ActionController::UnknownFormat Do I need to register the Mime type again ?

@westonganger
Copy link
Collaborator

Do you have a respond_to statement in your controller? If so it has to allow :pdf.

@solipet
Copy link

solipet commented Jan 23, 2017

@bhushangahire did you try something like this?:

# config/mime_types.rb
Mime::Type.register "application/pdf", :pdf

@westonganger
Copy link
Collaborator

This gem already registers that mime type. So you should not have to register it yourself.

@solipet
Copy link

solipet commented Jan 23, 2017

Ah, cool -- thanks!

@bhushangahire
Copy link
Author

Not sure what I did. But I guess we can close this.

@costa
Copy link

costa commented Sep 5, 2021

You have to restart the server upon serving your first prawn... for some reason.

@westonganger
Copy link
Collaborator

@costa this because it registers a new controller renderer for pdf.prawn files. You have to restart your server to get this installed. You should always be restarting your server after installing new gems amongst many other tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants