Sha256: 81f8d486de2199765b1b34164125601a9bac6dc97f6910251d88f50db72d68fc
Contents?: true
Size: 887 Bytes
Versions: 4
Compression:
Stored size: 887 Bytes
Contents
module Forms module Controllers module ApplicationController def self.included(base) base.class_eval do def current_response return @current_response if defined?(@current_response) @current_response = find_or_create_response if request.session[:form_response] end def find_response begin response = Response.find(request.session[:form_response]) rescue response = nil end end def find_or_create_response if find_response response = find_response else response = Response.create request.session[:form_response] = response.id end response end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems