Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ To participate, simply make an account, click on a vehicle image, and begin post


### Brief Example
Here's a sample snapshot:
Here's a sample snapshot:
![Wheeled Rider](https://i.imgur.com/l2T6Vg0.jpg)


### User Stories
Users are able to log into the site, choose (or make) a vehicle, select a representative image, and post a conntroversial opinion about their vehicle of choice.
Users are able to log into the site, choose (or make) a vehicle, select a representative image, and post a controversial opinion about their vehicle of choice.

### Technologies used
* Ruby
Expand All @@ -24,3 +24,7 @@ Users are able to log into the site, choose (or make) a vehicle, select a repres
https://wheeled-rider.herokuapp.com/

screencast: https://www.youtube.com/watch?v=PQbhtj6e7KQ&feature=youtu.be

<!-- Good job on the readme. Screenshot is a nice touch. Also include instructions on how to run the app locally. -->
<!-- Also, make sure your ERD reflects your current project, so make sure it includes comments -->
<!-- Also in terms of file structure, these outermost files should be inside of the Wheeled-Rider directory -->
12 changes: 7 additions & 5 deletions Wheeled-Rider/app/controllers/categories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def new
# create
def create
@category = Category.create(category_params.merge(user: current_user))

@category.save
# Nice job using the merge method
@category.save # you don't need .save if you call .create
redirect_to @category
end

Expand All @@ -24,7 +24,7 @@ def show

# edit
def edit
# @vehicle = Vehicle.find(params[:vehicle_id])
# @vehicle = Vehicle.find(params[:vehicle_id]) # No commented out code in production!
@category = Category.find(params[:id])
end

Expand All @@ -39,11 +39,13 @@ def update
def destroy
@category = Category.find(params[:id])
@category.destroy
redirect_to "/vehicles/"
redirect_to "/vehicles"
end

private
def category_params
params.require(:category).permit(:title, :author, :num_replies, :last_reply, :vehicle)
end
end # Nice job using params.require in a private method
end

# Dont really need the comments for the methods names here
6 changes: 4 additions & 2 deletions Wheeled-Rider/app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class CommentsController < ApplicationController
# index
def index
@comments = Comment.all
end
end # You can get rid of your index method and index views since its not being used.

# new
def new
Expand Down Expand Up @@ -33,7 +33,7 @@ def edit

# update
def update
@comment = category.find(params[:id])
@comment = Category.find(params[:id])
@comment.update(comment_params)
redirect_to @comment
end
Expand All @@ -50,3 +50,5 @@ def comment_params
params.require(:comment).permit(:contet, :author, :tier_of_reply, :time_posted, :category)
end
end

# Delete commented method names
4 changes: 2 additions & 2 deletions Wheeled-Rider/app/controllers/vehicles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def create
def show
@vehicle = Vehicle.find(params[:id])
@categories = Category.where(vehicle_id: params[:id])
# @categories = Category.all
# ^ This seems a little strange. You should be able to do @vehicle.categories to get all categories under a vehicle
end

def edit
Expand All @@ -33,7 +33,7 @@ def update
def destroy
@vehicle = Vehicle.find(params[:id])
@vehicle.destroy
redirect_to "/vehicles/"
redirect_to "/vehicles"
end

private
Expand Down
2 changes: 1 addition & 1 deletion Wheeled-Rider/app/models/category.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Category < ApplicationRecord
belongs_to :vehicle
belongs_to :vehicle # should also belong to users the way you have it mapped out.
has_many :comments
end
2 changes: 1 addition & 1 deletion Wheeled-Rider/app/views/categories/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<li>
<%= link_to category.title, category_path(category) %>
</li>
</br>
<br/>
<% end %>
</ul>
4 changes: 2 additions & 2 deletions Wheeled-Rider/app/views/categories/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2><%= @category.title %> </h2>

<body class = "category_show">

<!-- Need <ul> wrapper around your <li>'s -->
<li> <a href="/categories/">(go back)</a> </li>
<li> <a href="/comment/new">Reply to post</a> </li>
<li> <a href="/categories/<%= @category.id %>/edit">(edit category)</a></li>
Expand All @@ -10,7 +10,7 @@
<div class="category_link_wrapper">
<% 5.times do |category| %>
<div class="category_link">
<!-- comments go here -->

</div>

</div>
Expand Down
1 change: 0 additions & 1 deletion Wheeled-Rider/app/views/comments/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<h2>Edit Your Comment</h2>


<%= render 'form' %>

<%= link_to 'Delete!', comment_path(@comment), method: :delete, class: 'delete' %>
2 changes: 1 addition & 1 deletion Wheeled-Rider/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<%= link_to 'Login', new_user_session_path %>
<% end %>
</div>

<!-- Good job setting this up for so a non-user cant use your page -->


<%= yield %>
Expand Down
2 changes: 2 additions & 0 deletions Wheeled-Rider/app/views/vehicles/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
<%= f.submit %>

<% end %>

<!-- Nice job using _forms to keep things dry -->
1 change: 0 additions & 1 deletion Wheeled-Rider/app/views/vehicles/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<h2>Edit Vehicle</h2>


<%= render 'form' %>

<%= link_to 'Delete!', vehicle_path(@vehicle), method: :delete, class: 'delete' %>
8 changes: 5 additions & 3 deletions Wheeled-Rider/app/views/vehicles/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<div class="title_box_container">
<div class="title_box">
<h2>Welcome to Wheeled Rider!!!</h2>
<h3> A forum for enthusiasts of ALL vehicles on wheels <h3> <h5> <a href="/vehicles/new">(click here if there's a vehicle you want, but dont see)</a> </h5>
<h3> A forum for enthusiasts of ALL vehicles on wheels <h3>
<h5> <a href="/vehicles/new">(click here if there's a vehicle you want, but dont see)</a> </h5>
<!-- Probably doesn't need to be h5, just bold or something -->
</div>
</div>

<body background = "https://i.pinimg.com/originals/9f/32/5a/9f325a4a82e07083f703de79893a2b28.jpg">

<!-- You shouldn't be using body, that tag should only be used once in your app, and it should be in your layout page. Also, put the background property in css -->
<div id = "vehicle_image_wrapper">
<% @vehicles.each do |vehicle| %>
<div class="vehicle_image_container">
<a href="/vehicles/<%= vehicle.id %>">
<img class = "vehicle_image" src = "<%= vehicle.img_url%>" alt = "<%= vehicle.name%>" class = "vehicle_image">
<img class = "vehicle_image" src = "<%= vehicle.img_url%>" alt = "<%= vehicle.name%>" class = "vehicle_image">
</a>
</div>
<% end %>
Expand Down
11 changes: 4 additions & 7 deletions Wheeled-Rider/app/views/vehicles/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<body id = "vehicle_show">

<!-- Use a div instead of body -->
<h3> <%= @vehicle.name %> </h3>
<h5><a class="vehicle_show_edit_link" href="/vehicles/<%= @vehicle.id %>/edit">Edit page</a> </h5>


<ul>

<div class= "button_wrapper">

<a class = "button" href = "/categories/"> See all categories </a>
Expand All @@ -16,13 +13,13 @@
</br>
</br>
</br>

<!-- Instead of multiple line breaks, change margins instead -->
<div class="category_link_wrapper">
<% @categories.each do |category| %>

<a class="category_link_text" href="/categories/<%= category.id %>">
<div class="category_link">
<%= category.title %>
<div class="category_link"> <!-- might not need a nested div here -->
<%= category.title %>
</div>
</a>

Expand Down
16 changes: 7 additions & 9 deletions Wheeled-Rider/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

root to: 'vehicles#index'

resources :vehicles do
resources :categories
end

resources :categories do
resources :comments
end


resources :vehicles do
resources :categories
end

resources :categories do
resources :comments
end

end
3 changes: 3 additions & 0 deletions Wheeled-Rider/db/migrate/20171128150511_create_categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ def change
end
end
end

# good job using the foreign_key constraint however, you do not need to specify index: true as t.references will automatically add this constraint
# you would want to specify it if you used t.integer
4 changes: 3 additions & 1 deletion Wheeled-Rider/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
muni = unicycle.categories.create({title:"Muni: mountain unicycling", author:"pagemaker", num_replies: 0, last_reply: nil, vehicle: unicycle})
mewni = unicycle.categories.create({title:"Mewni: mountain unicycling", author:"pagemaker", num_replies: 0, last_reply: nil, vehicle: unicycle})
no_seat = bicycle.categories.create({title:"Riding without a seat", author:"pagemaker", num_replies: 0, last_reply: nil})

# I had no idea mountain unicycling was a thing...
# muni.comments.create ([{content:"I ride a 26er", tier_of_reply: 1, author:"pagemaker", time_posted: nil}])
# no_seat.comments.create ([{content:"Does it hurt for you folks?", tier_of_reply: 1, author:"pagemaker", time_posted: nil}])

Expand All @@ -30,3 +30,5 @@
# password: "12345678"
# )
# end

# Get rid of commented out code in production branch
21 changes: 21 additions & 0 deletions feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Project 2 Evaluation
[inline code comments]()
## Technical Requirements
**2: Performing**
>The app contains 2 models, with at least 1 association. At least 1 model is full CRUD.

## Creativity and Interface
**2: Performing**
>The app displays a personal spin or creative element through its written language, functionality, purpose, and/or CSS. Submission includes proof of HTML / CSS validation

## Code Quality
**1: Progressing**
>Code lacks proper formatting, includes commented out, non-functional code, or otherwise contains major issues of quality (DRY, naming, etc)

## Deployment and Functionality
**1: Progressing**
>Application contains minimal functionality, but deployment is non-functional, or application contains major errors when used

## Planning / Process / Submission
**1: Progressing**
>App is submitted, with basic evidence of planning. Documentation exists, but lacks common areas such as setup instructions, description of application functionality and link to deployed application