Skip to content

Commit

Permalink
Setup views
Browse files Browse the repository at this point in the history
  • Loading branch information
aviflombaum committed Aug 7, 2023
1 parent 024dee8 commit 2a5bbf3
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/tracks_controller.rb
@@ -0,0 +1,7 @@
class TracksController < ApplicationController
def new
end

def create
end
end
2 changes: 2 additions & 0 deletions app/helpers/tracks_helper.rb
@@ -0,0 +1,2 @@
module TracksHelper
end
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Expand Up @@ -12,7 +12,7 @@
</head>

<body>
<main class="container mx-auto mt-28 px-5 flex">
<main class="container mx-auto mt-8 px-5 flex">
<%= yield %>
</main>
</body>
Expand Down
4 changes: 4 additions & 0 deletions app/views/tracks/create.html.erb
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Tracks#create</h1>
<p>Find me in app/views/tracks/create.html.erb</p>
</div>
15 changes: 15 additions & 0 deletions app/views/tracks/new.html.erb
@@ -0,0 +1,15 @@
<div class="w-full">
<div class="p-6">
<div id="uploadzone" data-controller="uploads">
<button
id="dropzone_button"
data-action="click->uploads#activateDropzone"
class="w-full rounded-lg bg-muted border-2 border-dashed border-gray-300 p-8 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
<svg aria-hidden="true" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="mx-auto h-12 w-12 text-gray-400"><path d="M17.5 22h.5c.5 0 1-.2 1.4-.6.4-.4.6-.9.6-1.4V7.5L14.5 2H6c-.5 0-1 .2-1.4.6C4.2 3 4 3.5 4 4v3"></path><polyline points="14 2 14 8 20 8"></polyline><path d="M10 20v-1a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0Z"></path><path d="M6 20v-1a2 2 0 1 0-4 0v1a2 2 0 1 0 4 0Z"></path><path d="M2 19v-3a6 6 0 0 1 12 0v3"></path></svg>
<span class="mt-2 block text-sm font-semibold text-gray-900 dark:text-white">Drag Tracks to Upload or Click Here</span>
</button>
</div>
</div>
<div id="uploads" class="flex flex-col overflow-y-scroll divide-y border h-[calc(100vh-18em)]">
</div>
</div>
2 changes: 2 additions & 0 deletions config/routes.rb
@@ -1,4 +1,6 @@
Rails.application.routes.draw do
get 'tracks/new'
get 'tracks/create'
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
Expand Down
15 changes: 15 additions & 0 deletions spec/helpers/tracks_helper_spec.rb
@@ -0,0 +1,15 @@
require 'rails_helper'

# Specs in this file have access to a helper object that includes
# the TracksHelper. For example:
#
# describe TracksHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe TracksHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end
18 changes: 18 additions & 0 deletions spec/requests/tracks_spec.rb
@@ -0,0 +1,18 @@
require 'rails_helper'

RSpec.describe "Tracks", type: :request do
describe "GET /new" do
it "returns http success" do
get "/tracks/new"
expect(response).to have_http_status(:success)
end
end

describe "GET /create" do
it "returns http success" do
get "/tracks/create"
expect(response).to have_http_status(:success)
end
end

end
5 changes: 5 additions & 0 deletions spec/views/tracks/create.html.tailwindcss_spec.rb
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe "tracks/create.html.tailwindcss", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/views/tracks/new.html.tailwindcss_spec.rb
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe "tracks/new.html.tailwindcss", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end

0 comments on commit 2a5bbf3

Please sign in to comment.