From 40bb294c89636411eb4c464284b5f24d6623b902 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 9 Dec 2021 17:34:35 +0100 Subject: [PATCH] Edit --- wesweb01/crud-music-2020/views/albums/edit.slim | 4 ++++ wesweb01/crud-music-2020/views/albums/index.slim | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 wesweb01/crud-music-2020/views/albums/edit.slim diff --git a/wesweb01/crud-music-2020/views/albums/edit.slim b/wesweb01/crud-music-2020/views/albums/edit.slim new file mode 100644 index 0000000..8bdf4b8 --- /dev/null +++ b/wesweb01/crud-music-2020/views/albums/edit.slim @@ -0,0 +1,4 @@ +form action="/albums/#{album['AlbumId']}/update" method="post" + input type="text" name="new_title" value="#{album['Title']}" placeholder="Album title" + input type="number" name="new_artistid" value="#{album['ArtistId']}" placeholder="Artist ID" + input type="submit" value="Update" diff --git a/wesweb01/crud-music-2020/views/albums/index.slim b/wesweb01/crud-music-2020/views/albums/index.slim index 9633862..fe27e72 100644 --- a/wesweb01/crud-music-2020/views/albums/index.slim +++ b/wesweb01/crud-music-2020/views/albums/index.slim @@ -5,8 +5,10 @@ ol - albums.each do |album| li a href="albums/#{album['AlbumId']}" #{album["Title"]} + a href="albums/#{album['AlbumId']}/edit" Edit form action="albums/#{album['AlbumId']}/delete" method="post" input type="submit" value="Remove" +