Created
April 9, 2014 08:12
-
-
Save bhaskarkotu/10239855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generatereport | |
if !params[:id].blank? && Report.find(params[:id]) | |
respond_to do |format| | |
format.pdf do | |
render :pdf => "file_name", | |
:orientation => 'Portrait' | |
end | |
format.html | |
end | |
else | |
result['status'] &= false | |
result['error_messages'].push('Report does not exist with id '+ params[:id].to_s ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://localhost:3000/reports/1/generatereport path is showing up plain html file, where as http://localhost:3000/reports/1/generatereport.pdf saying missing template.