Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alison Z's mediaranker - kinda #27

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f598bf9
index page is working
AlisonZ Apr 13, 2017
95aad16
show page is working
AlisonZ Apr 13, 2017
d7d4736
user index page is showing html, no actual users added yet
AlisonZ Apr 13, 2017
706c255
sets up the login
AlisonZ Apr 13, 2017
1e79d8e
users are working, able to log in and out
AlisonZ Apr 13, 2017
b1818c2
vote method is working, but not working yet
AlisonZ Apr 13, 2017
2ef64f5
votes are counting. need to work on the flash messages and limiting o…
AlisonZ Apr 13, 2017
b8104a5
voting is working and only allowed once per person per item
AlisonZ Apr 14, 2017
df9e9b1
back to adding the votes.
AlisonZ Apr 14, 2017
e13784f
links from books index to individual show page. yaaaayayayayay!
AlisonZ Apr 14, 2017
373e4f8
added a movie controller and started to set up movie features
AlisonZ Apr 14, 2017
2f86eb1
whoops. i started workingon books because there's data there and forg…
AlisonZ Apr 14, 2017
5f0c19c
can add a new book
AlisonZ Apr 14, 2017
d8844ac
books can add and are redirected, error messages if they are not succ…
AlisonZ Apr 14, 2017
9c5dda7
can create new book
AlisonZ Apr 14, 2017
1223449
edit does not work. need to move on to delete and testing
AlisonZ Apr 14, 2017
0e0d52f
delete button is working
AlisonZ Apr 14, 2017
5d4f7f0
tests the validations on the model
AlisonZ Apr 14, 2017
2c2ede6
model tests are workings
AlisonZ Apr 14, 2017
f272057
tests for show
AlisonZ Apr 14, 2017
b7c415e
all three actions in the works controller are being tested and passing
AlisonZ Apr 14, 2017
8f4ae27
finished as many tests as i could
AlisonZ Apr 14, 2017
fccf769
removes the double migration info
AlisonZ Apr 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added a movie controller and started to set up movie features
AlisonZ committed Apr 14, 2017

Verified

This commit was signed with the committer’s verified signature.
commit 373e4f88272f89965dc9a11abde464e73351fd7a
3 changes: 3 additions & 0 deletions app/assets/javascripts/albums.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/javascripts/movies.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/albums.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the albums controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/movies.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the movies controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
5 changes: 5 additions & 0 deletions app/controllers/albums_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AlbumsController < ApplicationController
def index
@albums = Work.where(category: 'album')
end
end
9 changes: 9 additions & 0 deletions app/controllers/movies_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class MoviesController < ApplicationController
def index

end

def new

end
end
4 changes: 4 additions & 0 deletions app/controllers/works_controller.rb
Original file line number Diff line number Diff line change
@@ -9,4 +9,8 @@ def index
def show
@result_work = Work.find_by_id(params[:id])
end

def new

end
end
2 changes: 2 additions & 0 deletions app/helpers/albums_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module AlbumsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/movies_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module MoviesHelper
end
9 changes: 9 additions & 0 deletions app/views/albums/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<h1>Here's the albums</h1>
<ul>
<% @albums.each do |album| %>
<li>
<%= link_to album.title, work_path(album.id) %>
</li>
<% end %>

</ul>
1 change: 1 addition & 0 deletions app/views/movies/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>all movies</h1>
1 change: 1 addition & 0 deletions app/views/movies/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>add a new movie</h1>
4 changes: 2 additions & 2 deletions app/views/works/index.html.erb
Original file line number Diff line number Diff line change
@@ -3,15 +3,15 @@
<ul>
<% @movies.each do |movie| %>
<li>
<%= movie.title %> by: <%= movie.creator %>
<%= link_to movie.title, work_path(movie.id) %> by: <%= movie.creator %>
</li>
<% end %>
</ul>
<h2>Top Books</h2>
<ul>
<% @books.each do |book| %>
<li>
<%= book.title %> by: <%= book.creator %>
<%= link_to book.title, work_path(book.id) %> by: <%= book.creator %>
</li>
<% end %>
</ul>
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -16,5 +16,10 @@
get '/users/:id', to: 'users#show', as: 'user'

get '/movies', to: 'movies#index', as: 'movies'
get '/movies/new', to:'movies#new', as: 'new_movie'
post '/movies', to:'movies#create'


get '/books', to: 'books#index', as: 'books'
get '/albums', to: 'albums#index', as: 'albums'
end
7 changes: 7 additions & 0 deletions test/controllers/albums_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "test_helper"

describe AlbumsController do
# it "must be a real test" do
# flunk "Need real tests"
# end
end
7 changes: 7 additions & 0 deletions test/controllers/movies_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "test_helper"

describe MoviesController do
# it "must be a real test" do
# flunk "Need real tests"
# end
end