ruby on rails - Confused about the ways to write code for instance variables -


i quite confused on how write instance variables in rails.

 posted by: <%= link_to(@item.user.username, store_path(@item.user)) %>  price: <%= number_to_currency @item.price %> 

vs

subject: <%= subject_name @item %> 

i curious difference between (i) subject_name @item , (ii) @item.price?

is not supposed @item.subject_name?

i expect subject_name isn't variable, method. guess have method subject_name defined in 1 of helper files takes argument - @item in example.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -