Doesn't respond to custom request format

21 views
Skip to first unread message

itsmechlark

unread,
Jun 12, 2015, 12:42:13 PM6/12/15
to rubyonra...@googlegroups.com
I'm using `wicked_pdf` to handle PDF response but rails use HTML response even I already set route form to "pdf".
The `pdf` mime type already been registered.

At controller:
respond_to :pdf, only: :show

# GET /documents/1
# GET /documents/1.pdf
def show
retrieve_document_search_hits(@document)
respond_with(@document) do |format|
format.pdf { render pdf: @document.display_text }
format.html
end
end

rails v4.2.1
responders v2.1.0


Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages