abritium_app/app/controllers/public/testimonies_controller.rb
Nicolas Bally 69532530c2 suite
2019-05-30 14:44:41 +02: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