Skip to content
This repository
Browse code

Ensure installation works correctly.

* Update instructions
  • Loading branch information...
commit ae358a8c8ec5b067a4f4dba0be279762bb812d43 1 parent dc928d4
peakpg authored May 30, 2012
11  README.markdown
Source Rendered
@@ -15,18 +15,21 @@ A simple blog module that lets users create multiple blogs.
15 15
 
16 16
 The blog module installs like most other BrowserCMS modules (http://guides.browsercms.org/installing_modules.html)
17 17
 
18  
-    gem install bcms_blog
  18
+    $ gem install bcms_blog
19 19
     
20 20
 ## Set up your application to use the module
21 21
 
22 22
 ### 1. Install the module 
23 23
     
24  
-    rails g cms:install bcms_blog
  24
+    $ rails g cms:install bcms_blog
25 25
     
26 26
 ### 2. Run the following commands
27 27
   
28  
-    rake db:migrate
29  
-  	
  28
+    $ rake db:migrate
  29
+  	$ rake db:seed
  30
+
  31
+For projects with existing databases, you may need to comment out other lines in db/seeds.rb so only the blog seed data runs.
  32
+
30 33
 ## Creating a Blog
31 34
 
32 35
 * To get started, go to the Content Library and choose the Blog module in the left hand menu.
1  lib/bcms_blog.rb
... ...
@@ -1,4 +1,5 @@
1 1
 require "bcms_blog/engine"
  2
+require 'bcms_blog/route_extensions'
2 3
 
3 4
 module BcmsBlog
4 5
 end
1  lib/bcms_blog/engine.rb
... ...
@@ -1,5 +1,4 @@
1 1
 require 'browsercms'
2  
-require 'bcms_blog/route_extensions'
3 2
 
4 3
 module BcmsBlog
5 4
   class Engine < Rails::Engine
22  lib/generators/bcms_blog/install/install_generator.rb
@@ -2,17 +2,17 @@
2 2
 
3 3
 class BcmsBlog::InstallGenerator < Cms::ModuleInstallation
4 4
   add_migrations_directory_to_source_root __FILE__
5  
-
6  
-  # Add migrations to be copied, by uncommenting the following file and editing as needed.
7 5
   
8  
-  ['20090415000001_create_blog_posts.rb', '20090415000000_create_blogs.rb', '20090415000002_create_blog_comments.rb', 
9  
-    '20090415000003_add_attachment_to_blog_posts.rb', '20100521042244_add_moderate_comments_to_blog.rb'].each do |mg|
10  
-      copy_migration_file mg
11  
-    end
  6
+  def copy_migrations
  7
+    rake 'bcms_blog:install:migrations'
  8
+  end
  9
+    
  10
+  def add_seed_data_to_project
  11
+    copy_file "../bcms_blog.seeds.rb", "db/bcms_blog.seeds.rb"
  12
+    append_to_file "db/seeds.rb", "\nload File.expand_path('../bcms_blog.seeds.rb', __FILE__)\n"
  13
+  end
12 14
 
13  
-    def add_helpers
14  
-      append_to_file 'app/helpers/application_helper.rb', :after=>"module ApplicationHelper\n" do
15  
-        "  include Cms::BlogHelper\n"
16  
-      end
17  
-    end
  15
+  def add_routes
  16
+    route 'mount_bcms_blog'
  17
+  end
18 18
 end

0 notes on commit ae358a8

Please sign in to comment.
Something went wrong with that request. Please try again.