vita_app/app/controllers/public/events_controller.rb
Nicolas Bally 1d3af87d4c initial
2016-04-28 10:07:08 +02:00

39 lines
683 B
Ruby
Executable File

# -*- 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