Can't Convert Symbol into Integer

I must have really screwed something up big time. I was trying to modify SortHelper to work on multiple columns and now I can't get anything to work even though I reverted all my changes.

I keep getting the error: can't convert Symbol into Integer C:/Users/Eric Powell/Documents/ruby/my1fnc/app/helpers/sort_helper.rb:108:in `' C:/Users/Eric Powell/Documents/ruby/my1fnc/app/helpers/sort_helper.rb:108:in `sort_clause' C:/Users/Eric Powell/Documents/ruby/my1fnc/app/controllers/posts_controller.rb:29:in `index'

The offending line in sort_helper.rb is:     result = session[@sort_name][:key] + ' ' + session[@sort_name][:order]

Here's my entire SortHelper module:

module SortHelper

  require 'active_support/inflector'

  # Initializes the default sort column (default_key) with the following   # options:

Looks like at some point you stored something in session[@sort_name] that was an array - although you may have reverted the code that caused that to happen your old session is still there.

Fred

Frederick Cheung wrote: