From 52b044d6a4278c229992404ad5801769c2d13363 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 24 Aug 2025 20:29:54 +0200 Subject: First commit. Vive le Castel Peter ! --- .../_fertilizer_product.html.erb | 12 ++++++++++ app/views/fertilizer_products/_form.html.erb | 27 ++++++++++++++++++++++ app/views/fertilizer_products/edit.html.erb | 12 ++++++++++ app/views/fertilizer_products/index.html.erb | 16 +++++++++++++ app/views/fertilizer_products/new.html.erb | 11 +++++++++ app/views/fertilizer_products/show.html.erb | 10 ++++++++ 6 files changed, 88 insertions(+) create mode 100644 app/views/fertilizer_products/_fertilizer_product.html.erb create mode 100644 app/views/fertilizer_products/_form.html.erb create mode 100644 app/views/fertilizer_products/edit.html.erb create mode 100644 app/views/fertilizer_products/index.html.erb create mode 100644 app/views/fertilizer_products/new.html.erb create mode 100644 app/views/fertilizer_products/show.html.erb (limited to 'app/views/fertilizer_products') diff --git a/app/views/fertilizer_products/_fertilizer_product.html.erb b/app/views/fertilizer_products/_fertilizer_product.html.erb new file mode 100644 index 0000000..d84a03d --- /dev/null +++ b/app/views/fertilizer_products/_fertilizer_product.html.erb @@ -0,0 +1,12 @@ +
+

+ Name: + <%= fertilizer_product.name %> +

+ +

+ Purity: + <%= fertilizer_product.purity %> +

+ +
diff --git a/app/views/fertilizer_products/_form.html.erb b/app/views/fertilizer_products/_form.html.erb new file mode 100644 index 0000000..517fe09 --- /dev/null +++ b/app/views/fertilizer_products/_form.html.erb @@ -0,0 +1,27 @@ +<%= form_with(model: fertilizer_product) do |form| %> + <% if fertilizer_product.errors.any? %> +
+

<%= pluralize(fertilizer_product.errors.count, "error") %> prohibited this fertilizer_product from being saved:

+ + +
+ <% end %> + +
+ <%= form.label :name, style: "display: block" %> + <%= form.text_field :name %> +
+ +
+ <%= form.label :purity, style: "display: block" %> + <%= form.text_field :purity %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/app/views/fertilizer_products/edit.html.erb b/app/views/fertilizer_products/edit.html.erb new file mode 100644 index 0000000..aa88dad --- /dev/null +++ b/app/views/fertilizer_products/edit.html.erb @@ -0,0 +1,12 @@ +<% content_for :title, "Editing fertilizer product" %> + +

Editing fertilizer product

+ +<%= render "form", fertilizer_product: @fertilizer_product %> + +
+ +
+ <%= link_to "Show this fertilizer product", @fertilizer_product %> | + <%= link_to "Back to fertilizer products", fertilizer_products_path %> +
diff --git a/app/views/fertilizer_products/index.html.erb b/app/views/fertilizer_products/index.html.erb new file mode 100644 index 0000000..f624ffc --- /dev/null +++ b/app/views/fertilizer_products/index.html.erb @@ -0,0 +1,16 @@ +

<%= notice %>

+ +<% content_for :title, "Fertilizer products" %> + +

Fertilizer products

+ +
+ <% @fertilizer_products.each do |fertilizer_product| %> + <%= render fertilizer_product %> +

+ <%= link_to "Show this fertilizer product", fertilizer_product %> +

+ <% end %> +
+ +<%= link_to "New fertilizer product", new_fertilizer_product_path %> diff --git a/app/views/fertilizer_products/new.html.erb b/app/views/fertilizer_products/new.html.erb new file mode 100644 index 0000000..81aad79 --- /dev/null +++ b/app/views/fertilizer_products/new.html.erb @@ -0,0 +1,11 @@ +<% content_for :title, "New fertilizer product" %> + +

New fertilizer product

+ +<%= render "form", fertilizer_product: @fertilizer_product %> + +
+ +
+ <%= link_to "Back to fertilizer products", fertilizer_products_path %> +
diff --git a/app/views/fertilizer_products/show.html.erb b/app/views/fertilizer_products/show.html.erb new file mode 100644 index 0000000..ea97041 --- /dev/null +++ b/app/views/fertilizer_products/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @fertilizer_product %> + +
+ <%= link_to "Edit this fertilizer product", edit_fertilizer_product_path(@fertilizer_product) %> | + <%= link_to "Back to fertilizer products", fertilizer_products_path %> + + <%= button_to "Destroy this fertilizer product", @fertilizer_product, method: :delete %> +
-- cgit v1.2.3