negos_app/app/controllers/public/home_controller.rb
2017-10-09 18:08:19 +02:00

43 lines
792 B
Ruby
Executable File

class Public::HomeController < ApplicationController
layout "home"
def vouisstar
render :layout => "vouisstar"
end
def home
@articles = Article.before(Date.today).recents
@articles = @articles.page(params[:page]).per(4)
@title = "Articles du blog"
end
def affiliation
cookies.permanent[:mlm_token] = params[:mlm_token] if params[:mlm_token]
@parent = Customer.find_parrain(params[:mlm_token]) if params[:mlm_token]
if cookies[:mlm_token] and @parent = Customer.find_parrain(cookies[:mlm_token])
end
@no_search = true
render :layout => "public"
end
def redirect_affiliation
redirect_to "http://sideplace.com/affiliation/"+params[:mlm_token].to_s
end
end