title: Rails helper module undefined method `sort'
body: <p>I'm trying to create a simple helper module in rails, and I'm stumped on the following error message from my new person form (app/views/people/new.html.erb):</p>
  
  <pre><code>undefined method `sort' for 97:Fixnum
  
  Extracted source (around line #17):
  
  14:   &lt;p&gt;
  15:         &lt;% nations = { 'United States of America' =&gt; 'USA', 'Canada' =&gt; 'Canada', 'Mexico' =&gt; 'Mexico', 'United Kingdom' =&gt; 'UK' } %&gt;
  16:     &lt;%= f.label :country %&gt;&lt;br /&gt;
  17:         &lt;%= radio_buttons(:person, :country, nations) %&gt;
  18:         
  19:   &lt;/p&gt;
  20:   &lt;p&gt;
  </code></pre>
  
  <p>radio_buttons is a helper module I have created for my view.  Here it is (app/helpers/people_helper.rb):</p>
  
  <pre><code>module PeopleHelper 
  
  def radio_buttons(model_name, target_property, button_source) 
    html='' 
    list = button_source.sort 
    list.each do |x| 
      html &lt;&lt; radio_buttons(model_name, target_property, x[1]) 
      html &lt;&lt; h(x[0]) 
      html &lt;&lt; '&lt;br /&gt;' 
    end 
    return html 
  end 
  
  end
  </code></pre>
  
  <p>The problem appears to be on the "list = button_source.sort", but I'm not sure why it says the method is undefined.  I have been able to use it directly within my view code.  Am I not able to use methods like this within helper modules?  Do I need to include something?</p>
  
  <p>Thanks for any help!</p>