config/environments/development.rb
Set raise_delivery_errors
true on development
config.action_mailer.raise_delivery_errors = true
IMPORTANT
$ rails generate controller Noticias titulo | |
$ rails destroy controller Noticias titulo | |
$ rails generate model Noticia titulo:string | |
$ rails destroy model Noticia | |
$ rake db:migrate | |
$ rake db:rollback | |
$ rake db:migrate VERSION=0 #defaz todas as migrations, deixa o banco "limpo" |
@ViewContext.RouteData.GetRequiredString("action") |
group :production do | |
gem 'thin' | |
gem 'pg' | |
end | |
group :development, :test do | |
gem 'sqlite3' | |
end |
$ -> | |
$('#formId').validate | |
rules: { | |
'message[name]': "required" | |
'message[email]': 'required' | |
'message[subject]': 'required' | |
'message[body]': 'required' | |
} | |
submitHandler: (form) -> | |
$.post( |
public static void SendWithSMTP(string username, string password, string host, int port) | |
{ | |
using (var client = new System.Net.Mail.SmtpClient(host, port)) | |
{ | |
client.Credentials = new System.Net.NetworkCredential(username, password); | |
client.EnableSsl = true; | |
client.Send("from@example.com", "to@example.com", "This is a test subject.", "This is a test email message body."); | |
} | |
} |
$('body').on('hidden', '.modal', function () { | |
$(this).removeData('modal'); | |
}); |
SELECT DISTINCT Cadastro.id, Cadastro.nome, | |
STUFF( | |
(SELECT ', ' + Area.nome | |
FROM Area_Cadastro, Area | |
WHERE Cadastro.ID = Area_Cadastro.cadastro_id AND Area_Cadastro.area_id = Area.id | |
FOR XML PATH ('')) | |
, 1, 1, '') AS areas | |
FROM Cadastro |
string UserAgent = Request.UserAgent.ToString(); | |
UserAgent = UserAgent.ToLower(); | |
if (UserAgent.Contains("iphone") || UserAgent.Contains("symbianos") || UserAgent.Contains("ipad") || UserAgent.Contains("ipod") || UserAgent.Contains("android") || UserAgent.Contains("blackberry") || UserAgent.Contains("samsung") || UserAgent.Contains("nokia") || UserAgent.Contains("windows ce") || UserAgent.Contains("sonyericsson") || UserAgent.Contains("webos") || UserAgent.Contains("wap") || UserAgent.Contains("motor") || UserAgent.Contains("symbian")) | |
{ | |
Response.Write("Go with Mobile Device!!!"); | |
} | |
else | |
{ | |
Response.Write("Go with normal browser!!!"); |
string id = string.Empty; | |
if (!String.IsNullOrEmpty(@Model.Video)) | |
{ | |
System.Text.RegularExpressions.Regex regexYoutube = new System.Text.RegularExpressions.Regex("youtu(?:\\.be|be\\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]+)"); | |
System.Text.RegularExpressions.Match youtubeMatchs = regexYoutube.Match(Model.Video); | |
if (youtubeMatchs.Success) | |
{ | |
id = youtubeMatchs.Groups[1].Value; | |
} |