-1
reports.rb에서 출력 format.html하는레일 컨트롤러
def method
if self.name == "Maintenance History"
'maintenance_history'
elsif self.name == "Outstanding Maintenance"
'outstanding_maintenance'
elsif self.name == "Idle Time Report"
'idle_time_report'
end
end
def maintenance_history
maintenance_history.where(....)
end
def outstanding_maintenance
outstanding_maintenance.where(....)
end
def idle_time_report
idle_time_report.where(....)
end
reports_controller
def show
@report = Report.find(params[:id])
respond_to do |format|
format.html # show.html.erb
나는 HTML을 포맷하고 싶은
= render @report.method, :report => @report
show.html.haml 다음 태그가있는 내보기의 표 %table.table.datatable#datatable
이 : 내가 제대로 문제를 이해한다면
%table.table.datatable#datatable
= render @report.method, :report => @report
작동하지 않습니다 ...
'# datatable'을 (를) 타겟팅하는 스타일 시트에 규칙 집합을 추가 하시겠습니까? – numbers1311407
보기에서 내 보고서를 어떻게 표시하는지보십시오. 나는 단순히 컨트롤러 쇼라고 부른다. 여러 보고서가 있기 때문에 즉석에서 작성해야하지만 정렬이 가능하도록 표에 datatable css 태그를 추가해야합니다. – Bruno
'format.html' 인수없이'render '를 호출하십시오 show " . 평상시처럼 스타일을 추가하십시오. – jokklan