In Ruby 1.9 Symbol can receive [] and convert to a string and then
index. I've confirmed this works as expected  in the Rails console and
irb.

I have a model with a method_missing method defined. Like this:

def method_missing(name, *args, &block)
      if name[-1] == '='
         # Do some stuff and perhaps return
      end

      super
end

This throws: undefined method '[]' for :title:Symbol (NoMethodError)
'title' is one of the model's attributes that is getting sent to the
model in a view.
Does Rails monkey with Symbol somewhere and undefine []?
I'm stumped.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to