Store the remote host from which the preference originated
This commit is contained in:
parent
5d718ba214
commit
1c61e45146
|
@ -2,4 +2,11 @@ class ApplicationController < ActionController::Base
|
||||||
# Prevent CSRF attacks by raising an exception.
|
# Prevent CSRF attacks by raising an exception.
|
||||||
# For APIs, you may want to use :null_session instead.
|
# For APIs, you may want to use :null_session instead.
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def current_ip_address
|
||||||
|
# request.env['HTTP_X_FORWARDED_FOR'] ||
|
||||||
|
request.remote_ip
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,6 +10,7 @@ class TalkPreferencesController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@talk_preference = TalkPreference.new talk_preference_params
|
@talk_preference = TalkPreference.new talk_preference_params
|
||||||
|
@talk_preference.ip_address = current_ip_address
|
||||||
|
|
||||||
if @talk_preference.save
|
if @talk_preference.save
|
||||||
render json: {
|
render json: {
|
||||||
|
|
Loading…
Reference in New Issue