Archive: ComponentOwl Rails app, DB backups, go redirect script

This commit is contained in:
EC2 Default User
2026-03-23 16:20:05 +00:00
commit 50037f386f
218 changed files with 14558 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
class FaqsController < ApplicationController
before_filter :init_objects, :except => [:search]
before_filter :init_params, :only => [:search]
caches_page :index, :show
def index
render :action => "show"
end
def show
end
def search
#buga> uz budou mit dalsi produkty faqs, tohle se musi predelat
@product = featured_product
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @faqs }
end
end
private
def init_params
params[:search] ||= {}
params[:search] ||= {}
params[:search][:order] ||= "ascend_by_position"
@search = Faq.search(params[:search])
@faqs = @search.all
end
def init_objects
if params[:product]
@product = Product[params[:product]]
@categories = @product.faq_categories.all_ordered
else
@categories = FaqCategory.common
end
if params[:id]
@categories.each {|category| @category = category if category.url_param == params[:id] }
else
@category = @categories.first
end
@faqs = @category.faqs
@products = Product.all_ordered
end
end