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