Packages controller added

This commit is contained in:
Christoph Haas 2013-07-27 01:23:28 +02:00
parent f28c637d10
commit c2a695aec0
15 changed files with 110 additions and 1 deletions

View file

@ -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/

View file

@ -0,0 +1,3 @@
// Place all the styles related to the packages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View file

@ -0,0 +1,14 @@
class PackagesController < ApplicationController
def index
@packages = Package.order('name').first(20)
end
def with_screenshots
end
def without_screenshots
end
def moderate
end
end

View file

@ -0,0 +1,2 @@
module PackagesHelper
end

2
app/models/package.rb Normal file
View file

@ -0,0 +1,2 @@
class Package < ActiveRecord::Base
end

View file

@ -0,0 +1,10 @@
<h1>Packages#index</h1>
<p>Find me in app/views/packages/index.html.erb</p>
<ul>
<% @packages.each do |package| %>
<li>
<%= package.name %> <i>(<%= package.description %>)</i>
</li>
<% end %>
</ul>

View file

@ -0,0 +1,2 @@
<h1>Packages#moderate</h1>
<p>Find me in app/views/packages/moderate.html.erb</p>

View file

@ -0,0 +1,2 @@
<h1>Packages#with_screenshots</h1>
<p>Find me in app/views/packages/with_screenshots.html.erb</p>

View file

@ -0,0 +1,2 @@
<h1>Packages#without_screenshots</h1>
<p>Find me in app/views/packages/without_screenshots.html.erb</p>