Skip to content
Browse files

Proper Ruby syntax highlighting, 1.9 syntax consistency, combine 1st …

…& 2nd installation steps and a few layout fixes.
  • Loading branch information...
1 parent 54bc045 commit 8b5d69fc9f1d4ee338c9f8ccad714860045c1824 @olivierlacan olivierlacan committed May 27, 2012
Showing with 41 additions and 39 deletions.
  1. +41 −39 README.md
View
80 README.md
@@ -1,12 +1,10 @@
# MONOLOGUE
----
Monologue is a basic mountable blogging engine in Rails built to be easily mounted in an already existing Rails app, but it can also be used alone.
[![Build Status](https://secure.travis-ci.org/jipiboily/monologue.png)](http://travis-ci.org/jipiboily/monologue)
## Features
----
- Rails mountable engine (fully named spaced)
- tested
- back to basics: few features
@@ -23,64 +21,68 @@ Monologue is a basic mountable blogging engine in Rails built to be easily mount
## Installation
----
-1. add gem to your `Gemfile`
-
- gem "monologue"
-2. run
-
- $ bundle install
-3. add this to your route file (`config/route.rb`)
-
- # This line mounts Monologue's routes at the root of your application.
- # This means, any requests to URLs such as /my-post, will go to Monologue::PostsController.
- # If you would like to change where this engine is mounted, simply change the :at option to something different.
- #
- # We ask that you don't use the :as option here, as Monologue relies on it being the default of "monologue"
- mount Monologue::Engine, :at => '/' # or whatever path, be it "/blog" or "/monologue"
-
-4. run
-
- bundle exec rake monologue:install:migrations
- bundle exec rake db:create # only if this is a new project
- bundle exec rake db:migrate
+### 1. Add the gem to your `Gemfile`
+```ruby
+gem "monologue"
+```
+And run `bundle install` to fetch the gem and update your 'Gemfile.lock'.
+
+### 2. Route to Monologue
+
+Add this to your route file (`config/route.rb`)
+```ruby
+# This line mounts Monologue's routes at the root of your application.
+# This means, any requests to URLs such as /my-post, will go to Monologue::PostsController.
+# If you would like to change where this engine is mounted, simply change the :at option to something different.
+#
+# We ask that you don't use the :as option here, as Monologue relies on it being the default of "monologue"
+mount Monologue::Engine, :at => '/' # or whatever path, be it "/blog" or "/monologue"
+```
+
+### 3. Migrate Monologue's database tables
+Run these commands:
+
+1. $`bundle exec rake monologue:install:migrations`
+2. $`bundle exec rake db:create` (only if this is a new project)
+3. $`bundle exec rake db:migrate`
+
-5. Create a user
+### 4. Create a user
+Open your development console with `rails c`, then:
+```ruby
+Monologue::User.create(name: "monologue", email:"monologue@example.com", password:"my-password", password_confirmation: "my-password")
+```
- rails c
- Monologue::User.create(name: "monologue", email:"monologue@example.com", password:"my-password", password_confirmation: "my-password")
-
-6. Configure Monologue. This is all done in an initializer file, say `config/initializers/monologue.rb`. More on this in the [Wiki - Configuration](https://github.com/jipiboily/monologue/wiki/Configuration).
+### 5. Configure Monologue.
+This is all done in an initializer file, say `config/initializers/monologue.rb`. More on this in the [Wiki - Configuration](https://github.com/jipiboily/monologue/wiki/Configuration).
-7. Start your server and head on [http://localhost:3000/monologue](http://localhost:3000/monologue) to log in the admin section.
+### 6. Ready
+Start your server and head on [http://localhost:3000/monologue](http://localhost:3000/monologue) to log in the admin section.
### Note to Heroku users
-Additionnal step: turn caching off in `config/environments/production.rb`:
+Additionnal step: turn caching off in `config/environments/production.rb`:
```ruby
config.action_controller.perform_caching = true
```
## Enable caching
----
Just turn perform_caching to true in your environment config file (`config/environment/{environment}.rb):
-
- config.action_controller.perform_caching = true
+```ruby
+config.action_controller.perform_caching = true
+```
**IMPORTANT**: if monologue is mounted at root ("/"), you must also add that in your `routes.rb` file, before the monologue mount:
- root :to => 'monologue/posts#index'
+```ruby
+root to: 'monologue/posts#index'
+```
## Customization
----
-
See the [Wiki - Customizations](https://github.com/jipiboily/monologue/wiki/Customizations).
## Requirements
----
- Rails 3.1 +
- Database: MySQL & Postgres are supported but other databases might work too.
## Contribute
----
-
Fork it, then pull request. Please add tests for your feature or bug fix.

0 comments on commit 8b5d69f

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