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