hi, i want to pass the data between the controller, Eg: def a num = 10 print num end def b print num end if i load the b i want to get 10, how to do this? I tried to return the num that dint work. how to do this? -- regards, |Prashanth| http://munichlinux.blogspot.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 -~----------~----~----~----~------~----~------~--~---
..there may be simpler way, but the first most appropriate thing that pops into my mind is creating a module and including the module in both controllers as such: ====== controllers/one_controller.rb ======= class OneController include MyModule def a print_num end end ====== controllers/two_controller.rb ======= class TwoController include MyModule def b print_num end end ====== lib/my_module.rb ======= class MyModule def print_num n=10 print n end both actions return ''10'': domain.com/one/a domain.com/two/b hth :) -- 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 -~----------~----~----~----~------~----~------~--~---