Hi, When I define a "send" method in my Organise::MessageController class, and try to open the url http://127.0.0.1:3000/organise/message, I get an error saying "We''re sorry, but something went wrong"!, and when I remove this method, everything seems to work fine. Please, let me know why this happening. -thanks -- -nasa http://vikrant.co.in --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Vikrant Chaudhary wrote:> Hi, > When I define a "send" method in my Organise::MessageController class, and > try to open the url http://127.0.0.1:3000/organise/message, I get an error > saying "We''re sorry, but something went wrong"!, and when I remove this > method, everything seems to work fine. > Please, let me know why this happening. > -thanks >What does the error message in your log file say? -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Here is the complete log message - Processing MessageController#index (for 127.0.0.1 at 2007-10-07 09:48:15) [GET] Session ID: 663defd9462d72e29f440f9d50298ba6 Parameters: {"action"=>"index", "controller"=>"organise/message"} Processing MessageController#index (for 127.0.0.1 at 2007-10-07 09:48:15) [GET] Session ID: 663defd9462d72e29f440f9d50298ba6 Parameters: {"action"=>"index", "controller"=>"organise/message"} wrong number of arguments (1 for 0) C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in `send'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in `process_without_filters'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in `process_without_session_management_support'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in `process'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in `process'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in `handle_dispatch'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in `service'' C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'' C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' C:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'' C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'' C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'' C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'' C:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in `dispatch'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3 /lib/commands/servers/webrick.rb:59 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 2007/10/7, Michael Wang <rails-user-JtyympAsP2K7zZZRDBGcUA@public.gmane.org>:> > > Vikrant Chaudhary wrote: > > Hi, > > When I define a "send" method in my Organise::MessageController class, > and > > try to open the url http://127.0.0.1:3000/organise/message, I get an > error > > saying "We''re sorry, but something went wrong"!, and when I remove this > > method, everything seems to work fine. > > Please, let me know why this happening. > > -thanks > > > > What does the error message in your log file say? > > > -- > Michael Wang > > > >-- -nasa http://vikrant.co.in --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
send is a reserved word in rails because it uses send() a lot in the framework code to call methods dynamically. Rename your send method to send_message or anythign besides send and you will be fine. Cheers- -Ezra On Oct 6, 2007, at 9:19 PM, Vikrant Chaudhary wrote:> Here is the complete log message - > > Processing MessageController#index (for 127.0.0.1 at 2007-10-07 > 09:48:15) [GET] > Session ID: 663defd9462d72e29f440f9d50298ba6 > Parameters: {"action"=>"index", "controller"=>"organise/message"} > > > Processing MessageController#index (for 127.0.0.1 at 2007-10-07 > 09:48:15) [GET] > Session ID: 663defd9462d72e29f440f9d50298ba6 > Parameters: {"action"=>"index", "controller"=>"organise/message"} > wrong number of arguments (1 for 0) > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/base.rb:430:in `send'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/base.rb:430:in `process_without_filters'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/filters.rb:624:in > `process_without_session_management_support'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/session_management.rb:114:in `process'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/base.rb:330:in `process'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > `dispatch'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails- 1.2.3/lib/webrick_server.rb: > 113:in `handle_dispatch'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: > 79:in `service'' > > C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > > C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: > 63:in `dispatch'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ > webrick.rb:59 > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ > active_support/dependencies.rb:495:in `require'' > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ > active_support/dependencies.rb:495:in `require'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > > script/server:3 > > > 2007/10/7, Michael Wang < rails-user-JtyympAsP2K7zZZRDBGcUA@public.gmane.org>: > Vikrant Chaudhary wrote: > > Hi, > > When I define a "send" method in my Organise::MessageController > class, and > > try to open the url http://127.0.0.1:3000/organise/message, I get > an error > > saying "We''re sorry, but something went wrong"!, and when I > remove this > > method, everything seems to work fine. > > Please, let me know why this happening. > > -thanks > > > > What does the error message in your log file say? > > > -- > Michael Wang > > > > > -- > -nasa > http://vikrant.co.in >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Actually, send is reserved in Ruby, not just rails as it''s a method defined in Object: http://corelib.rubyonrails.org/classes/Object.html#M001077 Ezra Zygmuntowicz wrote:> send is a reserved word in rails because it uses send() a lot in the > framework code to call methods dynamically. Rename your send method > to send_message or anythign besides send and you will be fine. > > Cheers- > -Ezra > > > On Oct 6, 2007, at 9:19 PM, Vikrant Chaudhary wrote: > > >> Here is the complete log message - >> >> Processing MessageController#index (for 127.0.0.1 at 2007-10-07 >> 09:48:15) [GET] >> Session ID: 663defd9462d72e29f440f9d50298ba6 >> Parameters: {"action"=>"index", "controller"=>"organise/message"} >> >> >> Processing MessageController#index (for 127.0.0.1 at 2007-10-07 >> 09:48:15) [GET] >> Session ID: 663defd9462d72e29f440f9d50298ba6 >> Parameters: {"action"=>"index", "controller"=>"organise/message"} >> wrong number of arguments (1 for 0) >> >> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >> action_controller/base.rb:430:in `send'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >> action_controller/base.rb:430:in `process_without_filters'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >> action_controller/filters.rb:624:in >> `process_without_session_management_support'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >> action_controller/session_management.rb:114:in `process'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >> action_controller/base.rb:330:in `process'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in >> `dispatch'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/rails- 1.2.3/lib/webrick_server.rb: >> 113:in `handle_dispatch'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: >> 79:in `service'' >> >> C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' >> >> C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'' >> >> C:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: >> 63:in `dispatch'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ >> webrick.rb:59 >> >> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require'' >> >> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `require'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ >> active_support/dependencies.rb:495:in `require'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ >> active_support/dependencies.rb:342:in `new_constants_in'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ >> active_support/dependencies.rb:495:in `require'' >> >> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 >> >> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require'' >> >> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `require'' >> >> script/server:3 >> >> >> 2007/10/7, Michael Wang < rails-user-JtyympAsP2K7zZZRDBGcUA@public.gmane.org>: >> Vikrant Chaudhary wrote: >> >>> Hi, >>> When I define a "send" method in my Organise::MessageController >>> >> class, and >> >>> try to open the url http://127.0.0.1:3000/organise/message, I get >>> >> an error >> >>> saying "We''re sorry, but something went wrong"!, and when I >>> >> remove this >> >>> method, everything seems to work fine. >>> Please, let me know why this happening. >>> -thanks >>> >>> >> What does the error message in your log file say? >> >> >> -- >> Michael Wang >> >> >> >> >> -- >> -nasa >> http://vikrant.co.in >> >> > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hrm............................ irb(main):001:0> class Hacked irb(main):002:1> def send irb(main):003:2> "bwahaha I h4x0r3ed j00r s3nd!! pwnz0r" irb(main):004:2> end irb(main):005:1> end => nil irb(main):006:0> Hacked.new.send => "bwahaha I h4x0r3ed j00r s3nd!! pwnz0r" Ruby actually provides a __send__ method, simply because sometimes you DO want to write your own method named #send. So, send isn''t really a protected method at all. Neither is any other method on Object, for that matter, afaik. They''re just methods, so you can do whatever you want to them. Pat On 10/6/07, William Pratt <billp-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote:> > Actually, send is reserved in Ruby, not just rails as it''s a method defined > in Object: > > http://corelib.rubyonrails.org/classes/Object.html#M001077 > > > Ezra Zygmuntowicz wrote: > send is a reserved word in rails because it uses send() a lot in the > framework code to call methods dynamically. Rename your send method > to send_message or anythign besides send and you will be fine. > > Cheers- > -Ezra > > > On Oct 6, 2007, at 9:19 PM, Vikrant Chaudhary wrote: > > > > Here is the complete log message - > > Processing MessageController#index (for 127.0.0.1 at 2007-10-07 > 09:48:15) [GET] > Session ID: 663defd9462d72e29f440f9d50298ba6 > Parameters: {"action"=>"index", > "controller"=>"organise/message"} > > > Processing MessageController#index (for 127.0.0.1 at 2007-10-07 > 09:48:15) [GET] > Session ID: 663defd9462d72e29f440f9d50298ba6 > Parameters: {"action"=>"index", > "controller"=>"organise/message"} > wrong number of arguments (1 for 0) > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/base.rb:430:in `send'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/base.rb:430:in `process_without_filters'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/filters.rb:624:in > `process_without_session_management_support'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/session_management.rb:114:in `process'' > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/base.rb:330:in `process'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > `dispatch'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails- > 1.2.3/lib/webrick_server.rb: > 113:in `handle_dispatch'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: > 79:in `service'' > > C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > > C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in > `start_thread'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in > `start_thread'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'' > > C:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: > 63:in `dispatch'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ > webrick.rb:59 > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ > active_support/dependencies.rb:495:in `require'' > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ > active_support/dependencies.rb:495:in `require'' > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > > script/server:3 > > > 2007/10/7, Michael Wang < rails-user-JtyympAsP2K7zZZRDBGcUA@public.gmane.org>: > Vikrant Chaudhary wrote: > > > Hi, > When I define a "send" method in my Organise::MessageController > > class, and > > > try to open the url > http://127.0.0.1:3000/organise/message, I get > > an error > > > saying "We''re sorry, but something went wrong"!, and when I > > remove this > > > method, everything seems to work fine. > Please, let me know why this happening. > -thanks > > > What does the error message in your log file say? > > > -- > Michael Wang > > > > > -- > -nasa > http://vikrant.co.in > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
meh, by protected I meant reserved, hope it''s obvious On 10/6/07, Pat Maddox <pergesu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hrm............................ > > irb(main):001:0> class Hacked > irb(main):002:1> def send > irb(main):003:2> "bwahaha I h4x0r3ed j00r s3nd!! pwnz0r" > irb(main):004:2> end > irb(main):005:1> end > => nil > irb(main):006:0> Hacked.new.send > => "bwahaha I h4x0r3ed j00r s3nd!! pwnz0r" > > Ruby actually provides a __send__ method, simply because sometimes you > DO want to write your own method named #send. So, send isn''t really a > protected method at all. > > Neither is any other method on Object, for that matter, afaik. > They''re just methods, so you can do whatever you want to them. > > Pat > > On 10/6/07, William Pratt <billp-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote: > > > > Actually, send is reserved in Ruby, not just rails as it''s a method defined > > in Object: > > > > http://corelib.rubyonrails.org/classes/Object.html#M001077 > > > > > > Ezra Zygmuntowicz wrote: > > send is a reserved word in rails because it uses send() a lot in the > > framework code to call methods dynamically. Rename your send method > > to send_message or anythign besides send and you will be fine. > > > > Cheers- > > -Ezra > > > > > > On Oct 6, 2007, at 9:19 PM, Vikrant Chaudhary wrote: > > > > > > > > Here is the complete log message - > > > > Processing MessageController#index (for 127.0.0.1 at 2007-10-07 > > 09:48:15) [GET] > > Session ID: 663defd9462d72e29f440f9d50298ba6 > > Parameters: {"action"=>"index", > > "controller"=>"organise/message"} > > > > > > Processing MessageController#index (for 127.0.0.1 at 2007-10-07 > > 09:48:15) [GET] > > Session ID: 663defd9462d72e29f440f9d50298ba6 > > Parameters: {"action"=>"index", > > "controller"=>"organise/message"} > > wrong number of arguments (1 for 0) > > > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > > action_controller/base.rb:430:in `send'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > > action_controller/base.rb:430:in `process_without_filters'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > > action_controller/filters.rb:624:in > > `process_without_session_management_support'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > > action_controller/session_management.rb:114:in `process'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > > action_controller/base.rb:330:in `process'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in > > `dispatch'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/rails- > > 1.2.3/lib/webrick_server.rb: > > 113:in `handle_dispatch'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: > > 79:in `service'' > > > > C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > > > > C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in > > `start_thread'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in > > `start_thread'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'' > > > > C:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: > > 63:in `dispatch'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ > > webrick.rb:59 > > > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `gem_original_require'' > > > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `require'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ > > active_support/dependencies.rb:495:in `require'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ > > active_support/dependencies.rb:342:in `new_constants_in'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ > > active_support/dependencies.rb:495:in `require'' > > > > C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 > > > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `gem_original_require'' > > > > C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > > `require'' > > > > script/server:3 > > > > > > 2007/10/7, Michael Wang < rails-user-JtyympAsP2K7zZZRDBGcUA@public.gmane.org>: > > Vikrant Chaudhary wrote: > > > > > > Hi, > > When I define a "send" method in my Organise::MessageController > > > > class, and > > > > > > try to open the url > > http://127.0.0.1:3000/organise/message, I get > > > > an error > > > > > > saying "We''re sorry, but something went wrong"!, and when I > > > > remove this > > > > > > method, everything seems to work fine. > > Please, let me know why this happening. > > -thanks > > > > > > What does the error message in your log file say? > > > > > > -- > > Michael Wang > > > > > > > > > > -- > > -nasa > > http://vikrant.co.in > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 Oct 6, 2007, at 9:30 PM, William Pratt wrote:> Actually, send is reserved in Ruby, not just rails as it''s a method > defined in Object: > > http://corelib.rubyonrails.org/classes/Object.html#M001077It''s not exactly reserved as you can redefine it, but if you are running code that depends on using send to call methods(like rails) then redefining it is a bad idea. Cheers- -- Ezra --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Quite true, and should have been obvious from the start. Thanks for pointing that out. Pat Maddox wrote:> meh, by protected I meant reserved, hope it''s obvious > > On 10/6/07, Pat Maddox <pergesu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> hrm............................ >> >> irb(main):001:0> class Hacked >> irb(main):002:1> def send >> irb(main):003:2> "bwahaha I h4x0r3ed j00r s3nd!! pwnz0r" >> irb(main):004:2> end >> irb(main):005:1> end >> => nil >> irb(main):006:0> Hacked.new.send >> => "bwahaha I h4x0r3ed j00r s3nd!! pwnz0r" >> >> Ruby actually provides a __send__ method, simply because sometimes you >> DO want to write your own method named #send. So, send isn''t really a >> protected method at all. >> >> Neither is any other method on Object, for that matter, afaik. >> They''re just methods, so you can do whatever you want to them. >> >> Pat >> >> On 10/6/07, William Pratt <billp-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote: >> >>> Actually, send is reserved in Ruby, not just rails as it''s a method defined >>> in Object: >>> >>> http://corelib.rubyonrails.org/classes/Object.html#M001077 >>> >>> >>> Ezra Zygmuntowicz wrote: >>> send is a reserved word in rails because it uses send() a lot in the >>> framework code to call methods dynamically. Rename your send method >>> to send_message or anythign besides send and you will be fine. >>> >>> Cheers- >>> -Ezra >>> >>> >>> On Oct 6, 2007, at 9:19 PM, Vikrant Chaudhary wrote: >>> >>> >>> >>> Here is the complete log message - >>> >>> Processing MessageController#index (for 127.0.0.1 at 2007-10-07 >>> 09:48:15) [GET] >>> Session ID: 663defd9462d72e29f440f9d50298ba6 >>> Parameters: {"action"=>"index", >>> "controller"=>"organise/message"} >>> >>> >>> Processing MessageController#index (for 127.0.0.1 at 2007-10-07 >>> 09:48:15) [GET] >>> Session ID: 663defd9462d72e29f440f9d50298ba6 >>> Parameters: {"action"=>"index", >>> "controller"=>"organise/message"} >>> wrong number of arguments (1 for 0) >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >>> action_controller/base.rb:430:in `send'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >>> action_controller/base.rb:430:in `process_without_filters'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >>> action_controller/filters.rb:624:in >>> `process_without_session_management_support'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >>> action_controller/session_management.rb:114:in `process'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ >>> action_controller/base.rb:330:in `process'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in >>> `dispatch'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/rails- >>> 1.2.3/lib/webrick_server.rb: >>> 113:in `handle_dispatch'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: >>> 79:in `service'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in >>> `start_thread'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:162:in >>> `start_thread'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'' >>> >>> C:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: >>> 63:in `dispatch'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/ >>> webrick.rb:59 >>> >>> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >>> `gem_original_require'' >>> >>> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >>> `require'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ >>> active_support/dependencies.rb:495:in `require'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ >>> active_support/dependencies.rb:342:in `new_constants_in'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/activesupport- 1.4.2/lib/ >>> active_support/dependencies.rb:495:in `require'' >>> >>> C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 >>> >>> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >>> `gem_original_require'' >>> >>> C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >>> `require'' >>> >>> script/server:3 >>> >>> >>> 2007/10/7, Michael Wang < rails-user-JtyympAsP2K7zZZRDBGcUA@public.gmane.org>: >>> Vikrant Chaudhary wrote: >>> >>> >>> Hi, >>> When I define a "send" method in my Organise::MessageController >>> >>> class, and >>> >>> >>> try to open the url >>> http://127.0.0.1:3000/organise/message, I get >>> >>> an error >>> >>> >>> saying "We''re sorry, but something went wrong"!, and when I >>> >>> remove this >>> >>> >>> method, everything seems to work fine. >>> Please, let me know why this happening. >>> -thanks >>> >>> >>> What does the error message in your log file say? >>> >>> >>> -- >>> Michael Wang >>> >>> >>> >>> >>> -- >>> -nasa >>> http://vikrant.co.in >>> >>> >>> >>> >>> >>> >>> >>> > > >>> >>> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 10/6/07, Ezra Zygmuntowicz <ezmobius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It''s not exactly reserved as you can redefine it, but if you are > running code that depends on using send to call methods(like rails) > then redefining it is a bad idea.That''s what ''reserved'' means. You can define your own __send__, object_id, or class methods also -- boom. 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 -~----------~----~----~----~------~----~------~--~---
Well, now I know the reason! Thanks to you all. ( 8 answers just in 30 minutes! Its amazing! rails community is really helpful. Thanks again.) On Oct 7, 9:37 am, Ezra Zygmuntowicz <ezmob...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Oct 6, 2007, at 9:30 PM, William Pratt wrote: > > > Actually, send is reserved in Ruby, not just rails as it''s a method > > defined in Object: > > >http://corelib.rubyonrails.org/classes/Object.html#M001077 > > It''s not exactly reserved as you can redefine it, but if you are > running code that depends on using send to call methods(like rails) > then redefining it is a bad idea. > > Cheers- > -- Ezra--~--~---------~--~----~------------~-------~--~----~ 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 10/7/07, Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote:> > On 10/6/07, Ezra Zygmuntowicz <ezmobius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > It''s not exactly reserved as you can redefine it, but if you are > > running code that depends on using send to call methods(like rails) > > then redefining it is a bad idea. > > That''s what ''reserved'' means. > > You can define your own __send__, object_id, or class methods also -- boom.On the other had send IS usurped even in the Ruby standard library: $ qri send ------------------------------------------------------ Multiple choices: Object#send, Resolv::DNS::Requester::ConnectedUDP::Sender#send, Resolv::DNS::Requester::TCP::Sender#send, Resolv::DNS::Requester::UnconnectedUDP::Sender#send, SOAP::HTTPStreamHandler#send, UDPSocket#send -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.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 -~----------~----~----~----~------~----~------~--~---