Skip to content

Commit

Permalink
Remove the backend implementation of content#index per #87.
Browse files Browse the repository at this point in the history
  • Loading branch information
bamnet committed May 10, 2012
1 parent 6e69702 commit 160bfc3
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 27 deletions.
18 changes: 2 additions & 16 deletions app/controllers/contents_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ContentsController < ApplicationController
before_filter :get_content_const, :only => [:new, :create]
load_and_authorize_resource :except => [:index, :show]
load_and_authorize_resource :except => [:show]

# Grab the constent object for the type of
# content we're working with. Probably needs
Expand All @@ -13,20 +13,6 @@ def get_content_const
end
end

# GET /contents
# GET /contents.xml
def index
@contents = Content.all
@content_display = params[:type] || 'table'
@feeds = Feed.all
@screens = Screen.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @contents }
format.js { }
end
end

# GET /contents/1
# GET /contents/1.xml
def show
Expand Down Expand Up @@ -134,7 +120,7 @@ def destroy
@content.destroy

respond_to do |format|
format.html { redirect_to(contents_url) }
format.html { redirect_to(feeds_url) }
format.xml { head :ok }
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/contents/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<%= render 'form' %>
<%= link_to t(:show), @content %> |
<%= link_to t(:back), contents_path %>
<%= link_to t(:back), feeds_path %>
2 changes: 1 addition & 1 deletion app/views/contents/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@

<%= link_to "Media", @content.media.original.first unless @content.media.empty? || @content.media.original.empty? %>
<%= link_to 'Edit', edit_content_path(@content) %> |
<%= link_to 'Back', contents_path %>
<%= link_to 'Back', feeds_path %>
2 changes: 1 addition & 1 deletion app/views/elements/_topmenu_contents.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!-- Begin Menu for CONTENT -->
<section>
<div class="TM-sectop">
<%= link_to contents_path, :class => "btn #{ current_page?(contents_path) || current_page?(:controller => 'submissions', :action => 'index') || current_page?(:controller => 'submissions', :action => 'show') ? 'selected' : '' }" do %><%= t(:browse) %><% end %>
<%= link_to feeds_path, :class => "btn #{ current_page?(feeds_path) || current_page?(:controller => 'submissions', :action => 'index') || current_page?(:controller => 'submissions', :action => 'show') ? 'selected' : '' }" do %><%= t(:browse) %><% end %>
<%= link_to new_content_path, :class => "btn #{ current_page?(new_content_path) ? 'selected' : '' }" do %><%= t(:add) %><% end %>
</div>
<div class="TM-secbot">
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_index_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 id="contentlist">
<%= link_to "All Feeds", contents_path, :remote => true %> &gt;
<%= link_to "All Feeds", feeds_path, :remote => true %> &gt;
<% @feed.ancestors.reverse.each do |ancestor_feed| %>
<%= link_to ancestor_feed.name, feed_submissions_path(ancestor_feed), :remote => true %> &gt;
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_show_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 id="contentlist">
<%= link_to "All Feeds", contents_path, :remote => true %> &gt;
<%= link_to "All Feeds", feeds_path, :remote => true %> &gt;
<% @submission.feed.ancestors.reverse.each do |ancestor_feed| %>
<%= link_to ancestor_feed.name, feed_submissions_path(ancestor_feed), :remote => true %> &gt;
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@

# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
root :to => "contents#index"
root :to => "feeds#index"

# See how all your routes lay out with "rake routes"

Expand Down
5 changes: 0 additions & 5 deletions test/functional/contents_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ def setup
end
end

test "should get index" do
get :index
assert_response :success
end

test "should demoderate submissions on edit" do
sign_in users(:admin)
put :update, :id => contents(:sample_ticker).id, :duration => "7"
Expand Down

0 comments on commit 160bfc3

Please sign in to comment.