activeadmin-mongoid-blog 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -1
- data/activeadmin-mongoid-blog.gemspec +1 -1
- data/app/views/blog/_post.html.erb +6 -1
- data/app/views/blog/post.html.erb +6 -1
- data/lib/generators/active_admin/blog/templates/models/blog_post.rb +1 -5
- data/vendor/assets/stylesheets/activeadmin_mongoid_blog.css.scss +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -39,6 +39,8 @@ Install blog models, admin files, routes and blog controller, replace `blog` val
|
|
39
39
|
|
40
40
|
$ rails g active_admin:blog:install blog
|
41
41
|
|
42
|
+
Run `bundle` to install new gems.
|
43
|
+
|
42
44
|
As blog post editor `redactor.js` is used. It comes with a image uploading featured supported by **carrierwave**, install `Picture` model with command:
|
43
45
|
|
44
46
|
$ rails generate redactor:install
|
@@ -55,6 +57,6 @@ Add to your `active_admin.css.scss`:
|
|
55
57
|
|
56
58
|
Install default views templates to `/app/views/blog`:
|
57
59
|
|
58
|
-
$ rails g active_admin:blog:views
|
60
|
+
$ rails g active_admin:blog:views blog
|
59
61
|
|
60
62
|
### The End
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = 'activeadmin-mongoid-blog'
|
6
|
-
gem.version = '0.3.
|
6
|
+
gem.version = '0.3.1'
|
7
7
|
gem.summary = 'Blog app on the top of activeadmin and mongoid, using redactor and select2 plugins.'
|
8
8
|
gem.description = ''
|
9
9
|
gem.license = 'MIT'
|
@@ -7,7 +7,12 @@
|
|
7
7
|
|
8
8
|
<!-- CATEGORIES -->
|
9
9
|
<% if post.categories.size > 0 %>
|
10
|
-
<span>Posted in
|
10
|
+
<span>Posted in:</span>
|
11
|
+
<ul>
|
12
|
+
<% post.categories.each do |c| %>
|
13
|
+
<li><a href='<% blog_path() + "?category=#{c.name}"%>' title="<%= c.name %>"><%= c.name %></a></li>
|
14
|
+
<% end %>
|
15
|
+
</ul>
|
11
16
|
<% end %>
|
12
17
|
|
13
18
|
<!-- FEATURED IMAGE LINK --!>
|
@@ -9,7 +9,12 @@
|
|
9
9
|
|
10
10
|
<!-- CATEGORIES -->
|
11
11
|
<% if @post.categories.size > 0 %>
|
12
|
-
<span>Posted in
|
12
|
+
<span>Posted in:</span>
|
13
|
+
<ul>
|
14
|
+
<% @post.categories.each do |c| %>
|
15
|
+
<li><a href='<% blog_path() + "?category=#{c.name}"%>' title="<%= c.name %>"><%= c.name %></a></li>
|
16
|
+
<% end %>
|
17
|
+
</ul>
|
13
18
|
<% end %>
|
14
19
|
|
15
20
|
<!-- CONTENT -->
|
@@ -38,10 +38,6 @@ class BlogPost
|
|
38
38
|
false
|
39
39
|
end
|
40
40
|
|
41
|
-
def category_links_string
|
42
|
-
categories.collect{|c| link_to(c.name, admin_category_path(c))}.join(", ")
|
43
|
-
end
|
44
|
-
|
45
41
|
def excerpt
|
46
42
|
html = Nokogiri::HTML(content)
|
47
43
|
begin
|
@@ -56,7 +52,7 @@ class BlogPost
|
|
56
52
|
end
|
57
53
|
|
58
54
|
# Class methods
|
59
|
-
def published_in_category(category_slug)
|
55
|
+
def self.published_in_category(category_slug)
|
60
56
|
category = BlogCategory.find_by_permalink!(category_slug)
|
61
57
|
category.blog_posts.published
|
62
58
|
end
|