I am using the send method in one of my active records ... executing a method without any parameters works fine.. but when it comes to parameters it says ArgumentError: wrong number of arguments (1 for 0) u = User.new #works u.send :firstname #does not work => ArgumentError: wrong number of arguments (1 for 0) u.send :firstname, ''michal'' does someone know why? the rubydoc says that its possible to call it with params also... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 21, 2007 8:01 AM, Michal Gabrukiewicz < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am using the send method in one of my active records ... executing a > method without any parameters works fine.. but when it comes to > parameters it says > > ArgumentError: wrong number of arguments (1 for 0) > > u = User.new > #works > u.send :firstname > #does not work => ArgumentError: wrong number of arguments (1 for 0) > u.send :firstname, ''michal'' > > > does someone know why? the rubydoc says that its possible to call it > with params also... > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/20/07, Michal Gabrukiewicz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am using the send method in one of my active records ... executing a > method without any parameters works fine.. but when it comes to > parameters it says > > ArgumentError: wrong number of arguments (1 for 0) > > u = User.new > #works > u.send :firstname > #does not work => ArgumentError: wrong number of arguments (1 for 0) > u.send :firstname, ''michal''u.send ''firstname='', ''michal'' jeremy --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
>> p = Party.new=> <party object crap>>> p.send :name=> nil Works for me. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeremy Kemper wrote:> On 12/20/07, Michal Gabrukiewicz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> #does not work => ArgumentError: wrong number of arguments (1 for 0) >> u.send :firstname, ''michal'' > > u.send ''firstname='', ''michal'' > > jeremythanks jeremy that was it. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---