I have a partial form that should display remote_form_for or form_for depending on the value of the local variable passed to it from the view of the caller. Seem to be...
<% 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 %>
Obviously, I get a syntax error of about <% else%> because it expects an “end”.
What is the right way to do this?
source
share