Class: EntriesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/entries_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
# File 'app/controllers/entries_controller.rb', line 4

def index
  @entries = Entry.published.paginate(
    :page => (params[:page] || 1),
    :per_page => (SETTINGS.entries_per_page || 5)
  )
end

#showObject



11
12
13
14
15
# File 'app/controllers/entries_controller.rb', line 11

def show
  if entry.draft? && ! admin_signed_in?
    render 'public/404.html', :layout => false, :status => 404
  end
end