ecole_eft_app/app/controllers/public/testimonies_controller.rb
2017-03-25 13:22:54 +01:00

35 lines
507 B
Ruby

# -*- encoding : utf-8 -*-
class Public::TestimoniesController < ApplicationController
layout "public"
def show
if params[:slug]
testimony_id = params[:slug].split('-')[0].to_i
testimony = Testimony.find(:first, :conditions => {:id => testimony_id})
if testimony
@testimony = testimony
else
@testimony = Testimony.find(:first)
end
else
@testimony = Testimony.find(:first)
end
end
def index
@testimonies = Testimony.all
end
end