From fea9476a591559bd8fdcf17b64e5114c592a5b08 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Mon, 11 Nov 2024 16:55:14 +0100 Subject: C'est l'heure d'assurer le suivi de quelques flacons! --- app/views/wines/_form.html.erb | 33 +++++++++++++++++++++++++++++++++ app/views/wines/edit.html.erb | 5 +++++ app/views/wines/index.html.erb | 16 ++++++++++++++++ app/views/wines/new.html.erb | 5 +++++ app/views/wines/show.html.erb | 17 +++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 app/views/wines/_form.html.erb create mode 100644 app/views/wines/edit.html.erb create mode 100644 app/views/wines/index.html.erb create mode 100644 app/views/wines/new.html.erb create mode 100644 app/views/wines/show.html.erb (limited to 'app/views/wines') diff --git a/app/views/wines/_form.html.erb b/app/views/wines/_form.html.erb new file mode 100644 index 0000000..fe676b2 --- /dev/null +++ b/app/views/wines/_form.html.erb @@ -0,0 +1,33 @@ + + +<%= form_with model: wine do |form| %> +
+ <%= form.label :name %>
+ <%= form.text_field :name %> + <% wine.errors.full_messages_for(:name).each do |message| %> +
<%= message %>
+ <% end %> +
+ +
+ <%= form.label :year %>
+ <%= form.text_field :year %> + <% wine.errors.full_messages_for(:year).each do |message| %> +
<%= message %>
+ <% end %> +
+ +
+ <%= form.label :variety %>
+ <%= form.text_field :variety %> +
+ +
+ <%= form.label :notes %>
+ <%= form.text_field :notes %> +
+ +
+ <%= form.submit %> +
+<% end %> diff --git a/app/views/wines/edit.html.erb b/app/views/wines/edit.html.erb new file mode 100644 index 0000000..a97c707 --- /dev/null +++ b/app/views/wines/edit.html.erb @@ -0,0 +1,5 @@ + + +

Edit Wine

+ +<%= render "form", wine: @wine %> diff --git a/app/views/wines/index.html.erb b/app/views/wines/index.html.erb new file mode 100644 index 0000000..0202ada --- /dev/null +++ b/app/views/wines/index.html.erb @@ -0,0 +1,16 @@ + + +

Wines#index

+

List of wines

+ +<%= link_to "Add Wine", new_wine_path %> + + diff --git a/app/views/wines/new.html.erb b/app/views/wines/new.html.erb new file mode 100644 index 0000000..eeb6fd6 --- /dev/null +++ b/app/views/wines/new.html.erb @@ -0,0 +1,5 @@ + + +

Add Wine

+ +<%= render "form", wine: @wine %> diff --git a/app/views/wines/show.html.erb b/app/views/wines/show.html.erb new file mode 100644 index 0000000..cd8925d --- /dev/null +++ b/app/views/wines/show.html.erb @@ -0,0 +1,17 @@ + + +
  • <%= link_to "Back to homepage", root_path %>
  • + +

    <%= @wine.name %>

    +

    <%= @wine.year %>

    +

    <%= @wine.notes %>

    + + -- cgit v1.2.3