3
我有一個表單partial,需要根據從調用者視圖傳入的局部變量的值來呈現remote_form_for或form_for。它看起來像......rails條件表/ remote_form
<% if ajax %>
<% remote_form_for @search, :url => {:action => :search_set, :controller => :searches, :stype => stype} do |f| %>
<% else %>
<% form_for @search, :url => {:action => :search_set, :controller => :searches, :stype => stype} do |f| %>
<% end %>
很顯然,我越來越近<%其他%>語法錯誤,因爲它期望的「終結」。
什麼是正確的方法來做到這一點?
這是如何爲Rails 3? – Tony 2012-01-26 13:14:47