nova página sobre o font custom e action mailer

James Peret 9 years ago
parent
commit
6bd44bdff9
5 changed files with 119 additions and 1 deletions
  1. 3 1
      .gitignore
  2. 24 0
      fontcustom.md
  3. 41 0
      index.md
  4. 49 0
      mailer.md
  5. 2 0
      readme.md

+ 3 - 1
.gitignore

@@ -1,2 +1,4 @@
1 1
 .DS_Store
2
-Documentation/
2
+Documentation/
3
+mdwiki.html
4
+navigation.md

+ 24 - 0
fontcustom.md

@@ -0,0 +1,24 @@
1
+# Criando uma fonte customizada
2
+
3
+## Instalação do [Font Custom](http://fontcustom.com/)
4
+
5
+1. Primeiro instale o [XQuartz](https://xquartz.macosforge.org)
6
+
7
+2. Rode os seguintes comandos para instalar a ferramenta:
8
+
9
+```bash
10
+	brew install fontforge --with-python
11
+	brew install eot-utils
12
+	gem install fontcustom
13
+```
14
+
15
+## Utilização
16
+
17
+Rode o comando ```fontcustom compile``` para compilar e criar os arquivos da sua nova fonte.
18
+
19
+Para criar um arquivo de configuração, rode o comando ```fontcustom config /path/to/vectors```.
20
+
21
+## Links
22
+
23
+* [FontCustom](http://fontcustom.com/)
24
+* [FontCustom GitHub Page](https://github.com/FontCustom/fontcustom/)

+ 41 - 0
index.md

@@ -0,0 +1,41 @@
1
+## Index
2
+
3
+
4
+
5
+1. [Introdução](readme.md)
6
+1. [Instalação](instalacao.md)
7
+2. [Criando um projeto](criando%20um%20projeto.md)
8
+3. [Criando um banco de dados mySQL](mySQL.md)
9
+4. [Criando um banco de dados Postgres](Postgres.md)
10
+5. [Gerando um "Controller" e um "View"](Gerando%20um%20Controller%20e%20um%20View.md)
11
+6. [Routes](routes.md)
12
+7. [Render e redirecionamento](Render%20e%20Redirecionamento.md)
13
+8. [ERB View Templates](View%20Templates.md)
14
+9. [Instance Variables](Instance%20Variables.md)
15
+10. [Links](Links.md)
16
+11. [Parametros na URL](Parametros%20na%20URL.md) (GET e POST)
17
+12. [Rake](rake.md)
18
+13. [Migrations](migration.md)
19
+14. [ActiveRecord e ActiveRelations](ActiveRecord_ActiveRelation.md)
20
+15. [Gerando modelos](gerando_modelos.md)
21
+16. [Rails Console](rails_console.md)
22
+17. [Records](records.md)
23
+18. [Scopes](scopes.md)
24
+19. [Associações](associacoes.md)
25
+20. [CRUD](CRUD.md)
26
+21. [Scaffolding](scaffolding.md)
27
+22. [Helpers](helpers.md)
28
+23. [SimpleForm](SimpleForm.md)
29
+24. [Nested Model Forms](nested_model.md)
30
+25. [Autenticação de usuários com o Devise](devise.md)
31
+26. [Upload de arquivos com o CarrierWave](CarrierWave.md)
32
+27. [jQuery File Upload](jQuery_file_upload.md)
33
+28. [Testes](testes.md)
34
+29. [Twitter Bootstrap](twitter_bootstrap.md)
35
+30. [Cucumber](cucumber.md)
36
+31. [Controle de versão com Git](git.md)
37
+32. [Funções de tempo](time_ago.md)
38
+33. [Font Custom](fontcustom.md)
39
+33. [Mailer](mailer.md)
40
+
41
+*[Links de referencia](links_referencias.md)*

+ 49 - 0
mailer.md

@@ -0,0 +1,49 @@
1
+# Mailer
2
+
3
+A classe **ActionMailer** possibilita o aplicativo Rails a enviar emails e funciona como do mesmo jeito que um *Controller* e seus *Views*. Os arquivos dessa classe ficam na pasta ```app/mailers``` e os *Views* ficam em ```app/views```. 
4
+
5
+## Criando um novo Mailer
6
+
7
+Para criar uma nova classe, use o gerador na linha de comando:
8
+
9
+```rails generate mailer UserMailer```
10
+
11
+Os seguintes arquvos vão ser gerados:
12
+
13
+	create  app/mailers/user_mailer.rb
14
+	create  app/mailers/application_mailer.rb
15
+	invoke  erb
16
+	create    app/views/user_mailer
17
+	create    app/views/layouts/mailer.text.erb
18
+	create    app/views/layouts/mailer.html.erb
19
+	invoke  test_unit
20
+	create    test/mailers/user_mailer_test.rb
21
+	create    test/mailers/previews/user_mailer_preview.rb
22
+
23
+## Editando o Mailer
24
+
25
+
26
+O arquivo ```app/mailers/user_mailer.rb``` contem um novo mailer vazio
27
+	
28
+	class UserMailer < ApplicationMailer
29
+	end
30
+	
31
+Vamos agora criar uma novo metodo para enviar um email de boas vindas aos usuários:
32
+
33
+	class UserMailer < ApplicationMailer
34
+	  default from: 'notifications@example.com'
35
+	 
36
+	  def welcome_email(user)
37
+	    @user = user
38
+	    @url  = 'http://example.com/login'
39
+	    mail(to: @user.email, subject: 'Welcome to My Awesome Site')
40
+	  end
41
+	end
42
+
43
+<!-- Highlight syntax for Mou.app, insert at the bottom of the markdown document  -->
44
+ 
45
+<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
46
+<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/github.min.css">
47
+<script>
48
+  hljs.initHighlightingOnLoad();
49
+</script>

+ 2 - 0
readme.md

@@ -2,3 +2,5 @@
2 2
 por James Peret
3 3
 
4 4
 Anota&ccedil;&otilde;es dos estudos de Ruby on Rails de James Peret, baseado no curso da *Lynda.com* e no livro *"Agile Development with Ruby on Rails"* da editora *"Pragmatic Programmer"*.
5
+
6
+[Index](index.md)