Method: RdcmsHelper#render_address
- Defined in:
- app/helpers/rdcms_helper.rb
#render_address ⇒ Object
Renderiza o endereço formatado
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'app/helpers/rdcms_helper.rb', line 149 def render_address @companyName = Setting.get_object("rdcms.company.name") @companyAddress = Setting.get_object("rdcms.company.address") @companyDistrict = Setting.get_object("rdcms.company.district") @companyCep = Setting.get_object("rdcms.company.cep") @companyCity = Setting.get_object("rdcms.company.city") @companyState = Setting.get_object("rdcms.company.state") @companyCountry = Setting.get_object("rdcms.company.country") @companyPhone = Setting.get_object("rdcms.company.phone") @companyEmail = Setting.get_object("rdcms.company.email") # Dados a serem exibidos sobre a companhia address = "" address = "<strong>#{@companyName.value}</strong><br>" unless @companyName.value.empty? address << "#{@companyAddress.value}<br>" unless @companyAddress.value.empty? address << "#{@companyDistrict.value}" unless @companyDistrict.value.empty? address << ", CEP: #{@companyCep.value}" unless @companyCep.value.empty? address << "<br>" if !@companyDistrict.value.empty? or !@companyCep.value.empty? address << "#{@companyCity.value}" unless @companyCity.value.empty? address << " - #{@companyState.value}" unless @companyState.value.empty? address << ", #{@companyCountry.value}" unless @companyCountry.value.empty? address.html_safe end |