negos_app/app/controllers/public/home_controller.rb
2016-02-16 21:09:48 +01:00

40 lines
736 B
Ruby
Executable File

class Public::HomeController < ApplicationController
layout "home"
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