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
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ gem 'rails', '3.0.4'

gem 'sqlite3'
gem 'devise'

# Use unicorn as the web server
# gem 'unicorn'

Expand Down
18 changes: 4 additions & 14 deletions app/controllers/links_controller.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
class LinksController < ApplicationController
include LinksHelper

respond_to :html, :xml, :json
# GET /links
# GET /links.xml
def index
@links = Link.all.sort { |linka,linkb| votecount(linkb) <=> votecount(linka) }

respond_to do |format|
format.html # index.html.erb
end
respond_with(@links)
end

# GET /links/new
# GET /links/new.xml
def new
@link = Link.new

respond_to do |format|
format.html # new.html.erb
end
respond_with(@link)
end

# GET /links/1/edit
Expand Down Expand Up @@ -63,11 +57,7 @@ def update
# DELETE /links/1.xml
def destroy
@link = Link.find(params[:id])
@link.destroy

respond_to do |format|
format.html { redirect_to(links_url) }
end
respond_with(@link.destroy)
end

# PUT /links/1/upvote
Expand Down
2 changes: 1 addition & 1 deletion app/views/links/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<% if @links.count == 0 %>
<% if @links.empty? %>
<p>No links have been submitted. Click the link below to add one.</p>
<% else %>
<h2>Submitted Links</h2>
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
end

get "home/index"

devise_for :users

# The priority is based upon order of creation:
Expand Down