Skip to content

Commit

Permalink
fix sort on playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Apr 15, 2024
1 parent 39f95d2 commit 20b6f80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/playlists_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def sort
position = params.dig("section", "position")

collection = @playlist.track_playlists.find(id)
collection.insert_at(position + 1)
collection.insert_at(position)

flash[:now] = "successfully updated"

Expand Down
8 changes: 4 additions & 4 deletions app/views/playlists/_basic_info_tab.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<%= form.text_field :title %>
</div>

<div class="sm:col-span-6">
<%= form.text_area :description %>
</div>

<div class="sm:col-span-6">
<%= form.label :cover %>
<div class="mt-1 sm:mt-0 sm:col-span-6">
Expand All @@ -20,10 +24,6 @@
</div>
</div>

<div class="sm:col-span-6">
<%= form.text_area :description %>
</div>

<div class="sm:col-span-4">
<%= form.label :playlist_type %>
<%= form.select :playlist_type, Playlist::Types.plain, label: "Playlist type" %>
Expand Down
4 changes: 3 additions & 1 deletion app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
<div class="space-y-6 lg:col-start-1 lg:col-span-2">
<section class="">

<%= render "spotlights/form" %>
<% if @title == "Tracks" %>
<%= render "spotlights/form" %>
<% end %>


<div class="border-r-2--">
Expand Down

0 comments on commit 20b6f80

Please sign in to comment.