私のアプリケーションでは、ExcelとPDFを添付する必要がありますが、エラーが発生しています。以下はRoRでExcelとPdfが動作しない
ActionView::MissingTemplate: Missing template self_services/show, application/show with {:locale=>[:en], :formats=>[:xls], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :axlsx, :jbuilder]}. Searched in:
私のコントローラのコードです -
def show_self_datewise_attendance
@from = params[:employee][:from]
@to = params[:employee][:to]
@employee_attendances = EmployeeAttendance.where(day: @[email protected]_date,employee_id: current_user.employee_id)
respond_to do |format|
format.js
format.xls {render template: 'self_services/datewise_attendance_report_xls.xls.erb'}
format.html
format.pdf do
render pdf: 'datewise_attendance_report_pdf',
layout: 'pdf.html',
orientation: 'Landscape',
template: 'self_services/datewise_attendance_report_pdf.pdf.erb',
# show_as_html: params[:debug].present?,
:page_height => 1000,
:dpi => '300',
:margin => {:top => 10, # default 10 (mm)
:bottom => 10,
:left => 20,
:right => 20},
:show_as_html => params[:debug].present?
end
end
end
この希望を試してみてください。http://stackoverflow.com/questions/9561000/actionviewmissingtemplate-missing-template –
これまでの解決策はありましたか? –
まだ@AniketShivamTiwari –