@ sign means instance. the reason it is used in a controller is because it is global, hence the reason it can be accessed in a view? without the @ sign means it is local to the function right? -- 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 -~----------~----~----~----~------~----~------~--~---
bbqPlate wrote:> @ sign means instance. the reason it is used in a controller is because > it is global, hence the reason it can be accessed in a view? without the > @ sign means it is local to the function right? > > -- > Posted via http://www.ruby-forum.com/.@ means an instance variable. It''s not really global it''s local to the controller, but rails copies all controller instance variables to views when they are rendered so they are accessible there as well. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thx kevin. _Kevin wrote:> bbqPlate wrote: >> @ sign means instance. the reason it is used in a controller is because >> it is global, hence the reason it can be accessed in a view? without the >> @ sign means it is local to the function right? >> >> -- >> Posted via http://www.ruby-forum.com/. > > @ means an instance variable. It''s not really global it''s local to the > controller, but rails copies all controller instance variables to views > when they are rendered so they are accessible there as well. > > _Kevin-- 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 -~----------~----~----~----~------~----~------~--~---