process inscription
This commit is contained in:
parent
8399f37b09
commit
7766bf4b33
@ -68,9 +68,13 @@ class Public::CustomersController < ApplicationController
|
||||
params[:step] = "login"
|
||||
@no_search = true
|
||||
@customer = Customer.new(params.require(:customer).permit!)
|
||||
|
||||
@customer.account_validated = true
|
||||
|
||||
if @customer.save
|
||||
|
||||
@customer.reseauxes << Reseaux.find(16)
|
||||
@customer.reseauxes << Reseaux.find(2)
|
||||
@customer.domains << Domain.find(1)
|
||||
|
||||
CustomerMailer.confirm(@customer).deliver
|
||||
CustomerMailer.notify_ins(@customer).deliver
|
||||
|
||||
@ -80,12 +84,14 @@ class Public::CustomersController < ApplicationController
|
||||
cookies[:customer_auth_token] = @customer.token
|
||||
|
||||
|
||||
if session[:for_annonce]
|
||||
redirect_to new_public_annonce_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
||||
else
|
||||
redirect_to public_my_account_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
||||
end
|
||||
|
||||
#if session[:for_annonce]
|
||||
# redirect_to new_public_annonce_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
||||
#else
|
||||
# redirect_to public_my_account_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
||||
#end
|
||||
redirect_to public_my_reseauxes_path(), notice: "Vous êtes désormais inscrit."
|
||||
|
||||
|
||||
if cookies[:video_read] == "true"
|
||||
flash[:read_video] = false
|
||||
else
|
||||
|
@ -3,7 +3,7 @@ class Public::NeedsController < ApplicationController
|
||||
layout "public"
|
||||
before_filter :require_negos_abo
|
||||
before_filter :auth_customer
|
||||
before_filter :check_enabled
|
||||
#before_filter :check_enabled
|
||||
|
||||
|
||||
before_filter :build_category_tree, only:[:index,:new,:create,:edit,:update]
|
||||
@ -34,6 +34,7 @@ class Public::NeedsController < ApplicationController
|
||||
else
|
||||
@needs = @needs.where(:reseaux_id => nil)
|
||||
end
|
||||
|
||||
@needs = @needs.domain_in(current_customer.domain_ids)
|
||||
|
||||
# filters default value
|
||||
|
@ -86,7 +86,7 @@ class Customer < ActiveRecord::Base
|
||||
validates :cp, :presence => true, :if => :step2
|
||||
validates :city, :presence => true, :if => :step2
|
||||
|
||||
validates :need_1 , :presence => true, :if => :step3
|
||||
#validates :need_1 , :presence => true, :if => :step3
|
||||
|
||||
|
||||
# Geocoder
|
||||
|
Loading…
x
Reference in New Issue
Block a user