%%= javascript_tag do %> var new_<%=rule_name%> = '<%%=escape_javascript(render("/re_rules/<%=rule_name%>/form_word"))%>' $(document).ready(function() { $('#<%=rule_name%>_title').focus(); }); <%% end %> <%%= re_text_field "Title", "<%=rule_name%>_title", params[:<%=rule_name%>_title] || @re_rule.rule.title || @re_rule.rule.options[:display_name], :size => 30, :required => true, :error => @re_rule.rule.errors[:<%=rule_name%>_title], :span => '4x13' %> <%% position = 0 %> <%% (@re_rule.rule.match_words || []).each do | word | %> <%%= f.fields_for :rule_data, {:first => false} do |frd| %> <%%= render '/re_rules/<%=rule_name%>/form_word', :f => frd, :position => position, :word => word %> <%% position += 1 %> <%% end %> <%% end %> <%% if position == 0 %> <%%= f.fields_for :rule_data, {:first => false} do |frd| %> <%%= render '/re_rules/<%=rule_name%>/form_word', :f => frd, :position => position %> <%% end %> <%% end %>
<%%= re_form_text "", re_add_link('Add another word to filter', '<%=rule_name%>') %>