我希望使用link_to_unless_current來插入一些鏈接(與您一樣)。 我顯示的代碼是:Ruby on Rails link_to_unless_current不起作用
<div>
<div><% link_to_unless_current 'Right Eye', {:action => 'graphnew', :params => {:right => true}} %></div>
<div><% link_to_unless_current 'Left Eye', {:action => 'graphnew', :params => {:left => true}} %></div>
<div><% link_to_unless_current 'Both Eyes', {:action => 'graphnew'} %></div>
<div><% link_to_unless_current 'Show Natural History', {:action => 'graphnew', :params => {:nh => true}} %></div>
</div>
控制器是 「PatientsController」,動作是 「graphnew」,路線是:
/patients/:id/graphnew {:controller=>"patients", :action=>"graphnew"}
和它所有的渲染都是空白的div(<div></div>
) 。
唉!謝謝斯蒂芬! –
沒問題,歡呼! :) –