jquery - Setting a rails session in an ajax post -
kind of strange problem, can me out.
i want set session in rails controller hit via jquery ajax post.
its regular rails form submit via ajax
$.post($(this).attr('action'), $(this).serialize(), function(data){ }, 'json');
which hits leads controller
def create @lead = lead.new(params[:lead]) @lead.save! if @lead.save session[:lead] = "#{@lead.id}" end end
however session doesnt seem set across ajax call.
anyone have ideas on this?
did see create being called in controller (did appear in log)?
btw: you're calling save() twice, not problem (calling save multiple times returns true every time if save successful).
Comments
Post a Comment