Chris@1464: <%= title [l(:label_custom_field_plural), custom_fields_path], Chris@1464: [l(@custom_field.type_name), custom_fields_path(:tab => @custom_field.class.name)], Chris@1464: l(:label_custom_field_new) %> Chris@1464: Chris@1464: <%= labelled_form_for :custom_field, @custom_field, :url => custom_fields_path, :html => {:id => 'custom_field_form'} do |f| %> Chris@1464: <%= render :partial => 'form', :locals => { :f => f } %> Chris@1464: <%= hidden_field_tag 'type', @custom_field.type %> Chris@1464: <% end %> Chris@1464: Chris@1464: <%= javascript_tag do %> Chris@1464: $('#custom_field_field_format').change(function(){ Chris@1464: $.ajax({ Chris@1464: url: '<%= new_custom_field_path(:format => 'js') %>', Chris@1464: type: 'get', Chris@1464: data: $('#custom_field_form').serialize() Chris@1464: }); Chris@1464: }); Chris@1464: <% end %>