ecole_eft_app/app/controllers/public/testimonies_controller.rb
2013-07-18 01:23:48 +02:00

30 lines
450 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
end