letter_bomb 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/letter_bomb/mailers_controller.rb +14 -3
- data/lib/letter_bomb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c0f20e0d9f778d0c449863699c644761d7834fe
|
4
|
+
data.tar.gz: dd6dfb942f14ca1e333101df21e897b60407ac6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d80934dbdec296b6e4b155e4e6cd6ba22a193e1b47f27dde59db466532c03d8fc290caf872c8f47e914a1628bdb2d7d29698dbe807fa15086d989438995b21b
|
7
|
+
data.tar.gz: 5b489caf0a15aaa4bdd2793ae97d85ea99bd0f4de3fcef2f59b71c1dbd78356cdb90a2d753cd671e88aa83635795794855404ead90bb5d4f2a521a5f3e603041
|
@@ -10,16 +10,27 @@ module LetterBomb
|
|
10
10
|
@action = params[:mailer_action]
|
11
11
|
@mail = klass.constantize.preview_action(@action)
|
12
12
|
|
13
|
-
params[:format] ||=
|
13
|
+
params[:format] ||= content_type_html? ? "html" : "text"
|
14
14
|
|
15
15
|
respond_to do |format|
|
16
|
-
format.html
|
17
|
-
|
16
|
+
format.html {
|
17
|
+
render layout: "letter_bomb/application"
|
18
|
+
}
|
19
|
+
|
20
|
+
format.text {
|
21
|
+
render layout: "letter_bomb/application",
|
22
|
+
formats: [:html],
|
23
|
+
content_type: 'text/html'
|
24
|
+
}
|
18
25
|
end
|
19
26
|
end
|
20
27
|
|
21
28
|
private
|
22
29
|
|
30
|
+
def content_type_html?
|
31
|
+
@mail.content_type.match("text/html")
|
32
|
+
end
|
33
|
+
|
23
34
|
def body_part
|
24
35
|
return @mail unless @mail.multipart?
|
25
36
|
|
data/lib/letter_bomb/version.rb
CHANGED