From 4098264882dccef844346e6b0e2639e8a93471ed Mon Sep 17 00:00:00 2001 From: Andrea Manuel Date: Thu, 12 Oct 2023 20:23:34 -0600 Subject: [PATCH] Recover file --- app/views/recipe_foods/_form.html.erb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/views/recipe_foods/_form.html.erb diff --git a/app/views/recipe_foods/_form.html.erb b/app/views/recipe_foods/_form.html.erb new file mode 100644 index 0000000..4a2307d --- /dev/null +++ b/app/views/recipe_foods/_form.html.erb @@ -0,0 +1,14 @@ +<%= form_with(model:[recipe_food], class: 'container' ) do |form| %> +
+ <%= form.hidden_field :recipe_id, value: recipe.id %> + <%= form.collection_select :food_id, foods, :id, :name, class: 'select' %> +
+ <%= form.label :quantity, "Necessary quantity:", class: 'col-form-label' %> + <%= form.text_field :quantity, :required => true, class: 'form-control-lg', type: 'number', step: '0.1', min: 1, value: 1 %> +
+
+ <%= form.submit "Add", class: 'btn btn-success btn-lg' %> + <%= link_to 'Cancel', recipe_path(recipe.id), class: 'btn btn-danger btn-lg' %> +
+
+<% end %> \ No newline at end of file