Check if asset exists with find_asset
before include it.
<!-- Include javascript per-controller - vendor plugins -->
<%= javascript_include_tag params[:controller]
if ::Rails.application.assets.find_asset("#{params[:controller]}.js") %>
Paste your HTML in here and click Convert It!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta name="description" content="Exemple code of the HTML Email Basics Course of Treehouse" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>square gallery | Newsletter</title> | |
<!-- | |
This email is based on the idea that the most common design |
<script type="text/javascript"> | |
(function () { | |
var ss = document.createElement('script'); | |
ss.type = 'text/javascript'; | |
ss.async = true; | |
ss.src = '//app.shoptarget.com.br/js/tracking.js'; | |
var body = document.getElementsByTagName('body')[0]; // seleciona o elemento body | |
body.appendChild(ss); // adiciona elemento script antes do fechamento do elemento body | |
})(); | |
</script> |
<script type="text/javascipt"> | |
try{ | |
(function(window,document){ | |
head=document.getElementsByTagName('head')[0]; | |
script=document.createElement('script'); | |
// treat the hardcode script tag | |
head.appendChild(script); | |
})(window,document); | |
} catch(e) { | |
console.log('[GTM][Error in tag "nomeDaTag"]: '+e); |
public enum Status { | |
P("Pending"), | |
A("Approved"); | |
private String name; | |
Status(String name) { | |
this.name = name; | |
} |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
-- step 01 - Set the database into emergency mode | |
ALTER DATABASE yourDatabase SET EMERGENCY; | |
-- step 02 - Emegency mode repair | |
ALTER DATABASE yourDatabase SET SINGLE_USER | |
DBCC CHECKDB(yourDatabase, REPAIR_ALLOW_DATA_LOSS); | |
-- steop 03 - Unlock the database setting it into multiuser again | |
ALTER DATABASE yourDatabase SET MULTI_USER; |
-- ============================================================================ | |
-- 1. Limitamos o tamanho do log a 200MB com variação de 50MB; | |
-- alter log size of database | |
USE [yourDatabase]; | |
GO | |
ALTER DATABASE [yourDatabase] | |
MODIFY FILE | |
(NAME = yourDatabase_log,SIZE = 200MB, FILEGROWTH = 50MB); | |
GO |
USE [nomeSeuBancoDeDados]; | |
CHECKPOINT; | |
GO | |
CHECKPOINT; -- run twice to ensure database file wrap-around last transactions | |
GO | |
-- 200 MB | |
DBCC SHRINKFILE(nomeSeuBancoDeDados_log, 200); |