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

Comments, suggestions, compliments #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
7 changes: 7 additions & 0 deletions app/assets/javascripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
* To change this template use File | Settings | File Templates.
*/

/**
* Like I said in notes.txt, this is ALL you! I know you have frontend experience, and it's great to let it shine through here.
*
* One thing that strikes me is that your JS files and most of their functions are a bit long and complex. You might have difficulty changing things. You have lots of comments to remind you what the code does.
* Have you looked at Jasmine (https://github.com/pivotal/jasmine)? Or JS lint (http://www.jslint.com/)? Both are tools that could help you keep your JS complexity down.
*/

load("home#index", function (controller, action) {
var config = {
clientId: 'BCH20MFU1KWJNGTFVQHYSOQGDA42BZ5KYWGIQJW40HT4PAOT',
Expand Down
9 changes: 8 additions & 1 deletion app/controllers/kicks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class KicksController < ApplicationController
# Currently, this method returns this error when I navigate here:
# "There was an error saving your kick. Sorry!" If you don't want your
# users to access it, you should take it out.
def index
end

Expand All @@ -16,6 +19,9 @@ def new
end

def create
# You can leverage your ActiveRecord associations to do some of this heavy
# lifting. @kick.user = @user should be all you need. Then if you want the
# @kick's username, it's just @kick.user.name
@user = current_user
kick_params = params.require(:kick).permit(:title, :description, :time, :location, :user_id,
:latitude, :longitude,
Expand Down Expand Up @@ -59,7 +65,8 @@ def update
end
end


# In a RESTful world, this would live at kickin-it.com/users/#{user.id}/kicks
# In other words, this logic would live in the #index method
def mykicks
@user = User.find_by_id(current_user.id)
@kicks = @user.kicks
Expand Down
1 change: 1 addition & 0 deletions app/controllers/rsvp_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class RsvpController < ApplicationController
# Needed? If not, there's no reason to keep it. Trust in git!
end
2 changes: 2 additions & 0 deletions app/controllers/user_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def show
@user = User.find_by_permalink(params[:id])
end

# TODOs are a code smell: http://c2.com/cgi/wiki?CodeSmell. File issues in
# your GitHub repo instead.
##TODO -- refactor from profile controller

def update
Expand Down
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class User < ActiveRecord::Base
:storage => :s3, :s3_credentials => "#{::Rails.root}/config/s3.yml"


# Nicely done here. Simple, declarative methods.
def user_id
current_user.id
end
Expand Down
3 changes: 3 additions & 0 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<div class="kicks-all">
<button id="single-all" class="btn btn-info btn-block" data-text-single="Single view?" data-text-all="View All">Single view?</button>

<% =begin %>
This looks like a LOT of work. Great work getting all of this together and functional.
<% =end %>
<% @kicks.each do |kick| %>

<div class="kick-contr kick-list-<%= kick.id %>" id="<%= kick.id %>" >
Expand Down
8 changes: 7 additions & 1 deletion app/views/kicks/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<% =begin %>
I like your use of partials - this and _sidebar.html.erb in particular. Your views leverage partials and stay DRY. Great work!
<% end %>
<div class="new_kick">
<%= form_for(@kick) do |f| %>
<% if @kick.errors.any? %>
Expand Down Expand Up @@ -64,6 +67,9 @@
</div>


<% =begin %>
Hey! You know where this belongs! app/assets/javascripts/
<% =end %>
<script type="text/javascript">
function pick(data){
console.log(data);
Expand All @@ -72,4 +78,4 @@
imgres = '<img src=" ' + photo + ' ">';
jQuery(ele).fadeIn(800).append(imgres);
}
</script>
</script>
6 changes: 6 additions & 0 deletions notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- This is one of the best apps in the class! You've done so much outside the scope of the class to get your app up to the level it is now. I love the way Kickin It looks and feels, and it's really easy to navigate. All of that is on you - I know I didn't teach it!

- Using paperclip and AWS makes the application super-responsive, which I love. You did a great job with this.

- I gave plenty of comments on your JS and view files. Your views are well done and well-factored and you make great use of the asset pipeline. So when I give you advice on JS, just bear in mind it's because I know you're ready for the next level!