blog_eft_app/app/controllers/public/testimonies_controller.rb
Nicolas Bally 4c5f32ac28 suite
2021-05-16 21:11:57 +02:00

30 lines
432 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.where(:id => testimony_id).first
if testimony
@testimony = testimony
else
@testimony = Testimony.find(:first)
end
else
@testimony = Testimony.find(:first)
end
end
end