16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'app/controllers/riaction_genie/events_controller.rb', line 16
def create
if @profile.riaction_profile_keys.has_key?(params[:profile_type].try(:to_sym)) && params[:event_name].present?
IActionable::Api.new.log_event( params[:profile_type].to_s,
@profile.riaction_profile_keys[params[:profile_type].to_sym].first.first.to_s,
@profile.riaction_profile_keys[params[:profile_type].to_sym].first.last.to_s,
params[:event_name].to_s,
Rack::Utils.parse_nested_query(params[:event_params]) )
respond_to do |format|
format.json { render json: { id: @profile.id,
profile_type: params[:profile_type],
event_name: params[:event_name],
event_params: params[:event_params]
}, status: :created }
end
else
respond_to do |format|
format.json {render :nothing => true, :status => :unprocessable_entity}
end
end
end
|