ruby - Learning rails. Differences between, for instance, product, :product, @product, product.id, product_id -


so many variables , conventions in rails similar me. if isn't working , suspect particular variable culprit, might change from

variable 

to

@variable 

or might change

product_id 

to

product.id 

i'm shooting in dark, though. don't know used where, , i'd know key concepts.

variable 

could local variable or method in current scope.

@variable 

is instance variable, instance variables in other class.

product_id 

is again local variable or method in current scope.

and last one:

product.id 

product local variable or method , call id method on it. should invest more time trying learn ruby before trying use rails.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -