Esteban wrote in post #1058203:
Where can I find more information about the new syntax on these:
<%- model_class = @product.class -%>
Here the local variable model_class is assigned the value returned by
the instance method class. This would be the constant identifying the
class name of the instance variable @product. "Product' would most
likely be the name of the class returned and stored in model_class.
I've been using rails for a little bit and the "model_class = ..." is
new to me, plus I can't make sense of this:
<%=t '.title', :default => t('helpers.titles.new', :model =>
Here you are using the "t" method (a.k.a. "Translate"). It's part of the
Rails Internationalization (I18n).
Read more about the "t" method here:
Pay special attention to section 4.1.4 “Lazy” Lookup of the guide.>
model_class.model_name.human, :default => "New
Here you are calling the instance method "model_name", which is defined
in ActiveModel::Naming module. Using the method "human", defined in
ActiveModel:Name you get a humanized version of the name of the model
(i.e. "Purchase Order" instead of "PurchaseOrder").