chien_app/app/controllers/public/events_controller.rb
Nicolas Bally a1bba5a836 initial
2015-04-16 23:54:52 +02:00

39 lines
683 B
Ruby

# -*- encoding : utf-8 -*-
class Public::EventsController < ApplicationController
layout "public"
def archive
end
def index
@events = Event.before(Date.today).recents
@events = @events.page(params[:page]).per(3)
@title = "Events du blog"
end
def show
@event = Event.find_by_slug(params[:id])
if @event# and @event.enabled
@title = @event.title
@thumbnail_image = @event.image_file.file.large.medium.small.thumb.url if @event.image_file
else
redirect_to "/", :notice => "La page que vous demandez n'a pas pu être trouvée.<br /><br />Vous avez donc été redirigé sur notre page d'accueil"
end
end
end