ruby - Rails with HAML template Engine how label works in Haml? -
i new haml , not able understand old coder logic try identify label come on ui in haml template code main view page
= render :partial => "application/select_search", :locals => {:n => "benefit_stream_inf", :options => @dynamic_benefit_options, :default => true}
select_search page render in main plage
label = local_assigns[:l] ? l : t(n, :scope => local_assigns[:s] ? s : :models)
now not give label in render how lable generated
can 1 explain label assignment code
label = local_assigns[:l] ? l : t(n, :scope => local_assigns[:s] ? s : :models)
finly got answer
label = local_assigns[:l] ? l : t(n, :scope => local_assigns[:s] ? s : :models)
local_assigns[:l]
local variable used give label directly
t(n, :scope => local_assigns[:s] ? s : :models)
used fatch label value of translation file pass key , scope
and translation file put @ config/local/en.yml
Comments
Post a Comment