diff --git a/README b/README index e026a9e..54964d7 100644 --- a/README +++ b/README @@ -22,11 +22,17 @@ TODO: CHANGELOG: January 28, 2011 1. Completely re-wrote the 'edit' portion - 2. Session variables were disappearing randomly (no idea why). As a workaround, I made my own mini session handling using ActiveRecord. - Session variables would disappear and reappear between requests about 10% of the time, so I added a SessionWorkaround model that holds the action state, as well as the session_id. The session_id doesn't appear to change at all. I tried using an ActiveRecord Session Store, but this caused issues with the Uploadify Middleware workaround. + + 2. Session variables were disappearing randomly (no idea why). + As a workaround, I made my own mini session handling using ActiveRecord. + Session variables would disappear and reappear between requests about 10% of the time, + so I added a SessionWorkaround model that holds the action state, as well as the session_id. + The session_id doesn't appear to change at all. + I tried using an ActiveRecord Session Store, but this caused issues with the Uploadify Middleware workaround. January 23, 2011 1. Added form edit + 2. Verified it works in production mode in Mongrel/WebBrick/Passenger diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 46e29ae..91c96bb 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -104,7 +104,8 @@ def update private def translate_action - @_action = params[:_action] || SessionWorkaround.translate_action(params[:action]) + action = params[:_action] || params[:action] + @_action = SessionWorkaround.translate_action(action) end def get_image_uploads diff --git a/app/models/session_workaround.rb b/app/models/session_workaround.rb index ed503c3..5fa92ae 100644 --- a/app/models/session_workaround.rb +++ b/app/models/session_workaround.rb @@ -3,6 +3,7 @@ class SessionWorkaround < ActiveRecord::Base def self.translate_action(action) return "new" if action == "new" or action == "create" - return "edit" if action == "edit" or action == "update" + return "edit" if action == "edit" or action == "update" + nil end end