static_content 1.0.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/helpers/content_helper.rb +5 -0
- data/app/models/content.rb +12 -1
- data/lib/static_content/version.rb +1 -1
- metadata +5 -5
data/app/models/content.rb
CHANGED
@@ -5,8 +5,19 @@ class Content < ActiveRecord::Base
|
|
5
5
|
validates_uniqueness_of :slug
|
6
6
|
|
7
7
|
def parsed_text
|
8
|
-
|
8
|
+
markdown.to_html.html_safe
|
9
9
|
end
|
10
|
+
|
11
|
+
def raw_text
|
12
|
+
text.html_safe
|
13
|
+
end
|
14
|
+
|
15
|
+
def markdown
|
16
|
+
@content ||= RDiscount.new(text)
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
|
10
21
|
class << self
|
11
22
|
def from_slug(slug, options={})
|
12
23
|
raise NoDefaultContentError if options[:default].nil?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-08-
|
14
|
+
date: 2012-08-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -129,7 +129,7 @@ files:
|
|
129
129
|
- MIT-LICENSE
|
130
130
|
- Rakefile
|
131
131
|
- README.mkdn
|
132
|
-
homepage:
|
132
|
+
homepage: https://github.com/Helabs/static_content
|
133
133
|
licenses: []
|
134
134
|
post_install_message:
|
135
135
|
rdoc_options: []
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
segments:
|
145
145
|
- 0
|
146
|
-
hash:
|
146
|
+
hash: 2033020220625899342
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
segments:
|
154
154
|
- 0
|
155
|
-
hash:
|
155
|
+
hash: 2033020220625899342
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
158
|
rubygems_version: 1.8.24
|