Rails 3 アプリケーションでレポートと呼ばれるコントローラーを指定しました。コントローラのインデックス セクションは次のようになります。
def index
#@reports = Report.all
@clinical_income_by_month = Clinical.income_by_month
@clinical_income_by_employee = Clinical.income_by_employee
@clinical_income_by_vet = Clinical.income_by_vet
@consult_consult_times = Consult.consult_times
@clinical_healthplan_high_spenders = Clinical.healthplan_high_spenders
respond_to do |format|
format.html # index.html.erb
format.json { render json: @reports }
end
end
index.html.erb コードは次のようになります。
<h6><b>Financial Reports</b></h6>
<dl class="vertical">
<dd><a href="/income_by_month">Income by Month</a></dd>
<dd><a href="/income_by_employee">Income by Employee</a></dd>
<dd><a href="/income_by_vet">Income by Vet</a></dd>
</dl>
jQuery タブの下の index.html.erb にもともとあったレポートを、独自のページに分割しました。
個々のレポートへのリンクをロードする最善の方法は何ですか? 現在、リンクにアクセスするか手動でhttp://0.0.0.0:3000/reports/income_by_month.htmlと入力すると、不明なページ エラーが発生します。
任意のポインタをいただければ幸いです!