I''m looking at an example here: http://stackoverflow.com/questions/1330273/how-to-calculate-difference-of-two-fields-on-form-submit-ruby-on-rails And, came along this line in MyModel: attr_accessor :start_amount, :end_amount What is "attr_accessor"? Thanks. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sep 22, 8:37 am, Abder-Rahman Ali <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''m looking at an example here:http://stackoverflow.com/questions/1330273/how-to-calculate-differenc... > > And, came along this line in MyModel: > > attr_accessor :start_amount, :end_amount > > What is "attr_accessor"?This isn''t a Rails specific question, as attr_accessor is built-in Ruby functionality. Perhaps you should take a look at a Ruby tutorial about classes: http://juixe.com/techknow/index.php/2007/01/22/ruby-class-tutorial/ -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 22 September 2010 13:37, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''m looking at an example here: > http://stackoverflow.com/questions/1330273/how-to-calculate-difference-of-two-fields-on-form-submit-ruby-on-rails > > And, came along this line in MyModel: > > attr_accessor :start_amount, :end_amount > > What is "attr_accessor"?Can I ask how long you spent trying to answer this for yourself? _Please_ do some basic Ruby tutorials and also get and read the Pickaxe Ruby book. If you keep asking such basic questions here people will eventually get tired of answering them, and when you really need help with a tricky problem you will have used up all your calling credit. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
on the comments example i gave you go to the article.rb there is an explanation also look at this http://railscasts.com/episodes/26-hackers-love-mass-assignment you can mail me directly for simple questions like this at rbritom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org that way you wont use up all your "calling credit" -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks all for your replies. And, really appreciate it @radhames. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Abder-Rahman Ali wrote:> I''m looking at an example here: > http://stackoverflow.com/questions/1330273/how-to-calculate-difference-of-two-fields-on-form-submit-ruby-on-rails > > And, came along this line in MyModel: > > attr_accessor :start_amount, :end_amount > > What is "attr_accessor"?It''s a sign that you need to go learn Ruby. :)> > Thanks.Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sure @Marnen :-) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I think this is a nice one: http://blog.hulihanapplications.com/browse/view/3-attr-accessor-and-ruby-object-variables -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.