api contact
This commit is contained in:
parent
4191300c44
commit
8fd16e2b28
4
Gemfile
4
Gemfile
@ -70,4 +70,6 @@ gem 'curb'
|
|||||||
|
|
||||||
gem 'kaminari-bootstrap'
|
gem 'kaminari-bootstrap'
|
||||||
|
|
||||||
gem 'fastimage'
|
gem 'fastimage'
|
||||||
|
|
||||||
|
gem 'curb'
|
@ -10,5 +10,34 @@ class ContactController < ApplicationController
|
|||||||
@lang = LangSite.first
|
@lang = LangSite.first
|
||||||
@params = params
|
@params = params
|
||||||
DemandeMail.prise(@params).deliver
|
DemandeMail.prise(@params).deliver
|
||||||
|
|
||||||
|
|
||||||
|
api_url = "http://#{UAL_API_HOST}/admin/contacts/api"
|
||||||
|
|
||||||
|
|
||||||
|
@c = Curl::Easy.new(api_url) do |curl|
|
||||||
|
curl.verbose = true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@c.http_post(
|
||||||
|
Curl::PostField.content(:name, @params[:name]),
|
||||||
|
Curl::PostField.content(:address, @params[:address]),
|
||||||
|
Curl::PostField.content(:address2, @params[:address2]),
|
||||||
|
Curl::PostField.content(:cp, @params[:cp]),
|
||||||
|
Curl::PostField.content(:city, @params[:city]),
|
||||||
|
Curl::PostField.content(:tel, @params[:tel]),
|
||||||
|
Curl::PostField.content(:mail, @params[:mail]),
|
||||||
|
Curl::PostField.content(:place, @params[:place]),
|
||||||
|
Curl::PostField.content(:type, @params[:type].to_s),
|
||||||
|
Curl::PostField.content(:owner, @params[:owner].to_s),
|
||||||
|
Curl::PostField.content(:message, @params[:message])
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
@debug = @c.body_str
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -43,4 +43,5 @@ Rails.application.configure do
|
|||||||
|
|
||||||
config.action_mailer.delivery_method = :file
|
config.action_mailer.delivery_method = :file
|
||||||
config.action_mailer.default_url_options = { :host => HOSTNAME }
|
config.action_mailer.default_url_options = { :host => HOSTNAME }
|
||||||
|
UAL_API_HOST = "localhost:3000"
|
||||||
end
|
end
|
||||||
|
@ -77,8 +77,8 @@ Rails.application.configure do
|
|||||||
# Do not dump schema after migrations.
|
# Do not dump schema after migrations.
|
||||||
config.active_record.dump_schema_after_migration = false
|
config.active_record.dump_schema_after_migration = false
|
||||||
|
|
||||||
HOSTNAME="test.com"
|
HOSTNAME="luxlaverie.com"
|
||||||
|
UAL_API_HOST = "une-autre-laverie.com"
|
||||||
#config.action_mailer.delivery_method = :file
|
#config.action_mailer.delivery_method = :file
|
||||||
config.action_mailer.default_url_options = { :host => HOSTNAME }
|
config.action_mailer.default_url_options = { :host => HOSTNAME }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user