11155
(-- --)
September 22, 2010, 12:37pm
1
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.
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:
Colin_Law1
(Colin Law)
September 22, 2010, 12:57pm
3
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
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@gmail.com
that way you wont use up all your “calling credit”
11155
(-- --)
September 22, 2010, 2:11pm
5
Thanks all for your replies.
And, really appreciate it @radhames .
11155
(-- --)
September 22, 2010, 4:41pm
6
Abder-Rahman Ali wrote:
I'm looking at an example here:
How to calculate difference of two fields on form submit Ruby on Rails - Stack Overflow
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,
11155
(-- --)
September 22, 2010, 4:56pm
8
I think this is a nice one: