title: Excel and Pdf not working in RoR
body: <p>In my application , I have to attach the excel and pdf but it is throughing  an error . </p>
  
  <pre><code>ActionView::MissingTemplate: Missing template self_services/show, application/show with {:locale=&gt;[:en], :formats=&gt;[:xls], :variants=&gt;[], :handlers=&gt;[:erb, :builder, :raw, :ruby, :coffee, :axlsx, :jbuilder]}. Searched in:
  </code></pre>
  
  <p>Below is my controller code -</p>
  
  <pre><code>def show_self_datewise_attendance
      @from = params[:employee][:from]
      @to = params[:employee][:to]
      @employee_attendances = EmployeeAttendance.where(day: @from.to_date..@to.to_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      =&gt; 1000,
                :dpi              =&gt; '300',
                :margin           =&gt; {:top    =&gt; 10, # default 10 (mm)
                              :bottom =&gt; 10,
                              :left   =&gt; 20,
                              :right  =&gt; 20},
                :show_as_html =&gt; params[:debug].present?
            end
          end
    end
  </code></pre>