small medium large xlarge

03 Aug 2009, 12:03
Sarun Wongpatcharapakorn (5 posts)

While I am reading page 161 at the end I see foot note describe about self.salt and this confused me. First I have to tell I didn’t have experienced in ruby before. I jump into this rail (have read appendix A about ruby) and what bother me along the way is variable ruby has :var, @var, var, and now self.var . I not sure I can use this in the right place and don’t understand what writing in foot note page 161.

What I want to know is what is the difference between these var. I see I can interchangable use between : and ‘’ in :action like ` <% form_for :order, :url => {:action => :save_order} <% form_remote_tag :url => {:action => ‘remove_from_cart’, :id => product} do %> <%= submit_tag “Remove from cart” %> <% end %> ` And when save item to database I saw they used constructor with : to assign var to model like ` :product => @product, :quantity => @quantity, :total_price => self.price ` how do I assign var to model object for the field in the db?

Thank you,

You must be logged in to comment