$("#ingredient_form").replaceWith($("<%= escape_javascript(render(partial: 'ingredients/form')) %>")); window.INGREDIENT_API.initialize();