Kind of a weird problem, hope someone can help me.
I want to establish a session in my rails controller which I hit through a jquery ajax post.
Its a regular rails form that I post via ajax
$.post($(this).attr('action'), $(this).serialize(), function(data){
}, 'json');
which gets into the wire controller
def create
@lead = Lead.new(params[:lead])
@lead.save!
if @lead.save
session[:lead] = "#{@lead.id}"
end
end
however, the session does not seem to be set to an ajax call.
Anyone have any ideas on this?
source
share