Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Basic weblog based on Rails 3.2

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 log
Octocat-spinner-32 public
Octocat-spinner-32 script
Octocat-spinner-32 spec
Octocat-spinner-32 vendor
Octocat-spinner-32 .env_example
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 Procfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
README.md

WebL

Basic weblog based on Rails 3.1 with roles for authors next to admins. Feel free to take a look at a running blog of the current version here.

Progress

The basics seems to be mostly covered on the back end. CanCan is used to distinguish between guests, registered users, authors and admins. For admins there is an admin namespace where users and posts can be edited. There is also an index of comments which might help when removing spammy comments in bulk.

Redcarpet is used to provide markdown in posts. It is the only option for formatting available, but those inclined can easily change this as everything is passed through the markdown helper function in the application helper.

Lay-out

No significant lay-out has been created. Some basics with Twitter's bootstrap have been introduced so that there is at least something to look at.

Deploying on Heroku

Installing the app is fairly trivial, just clone this repository and create a valid .env file. (there is an example in .env_example. Don't forget to generate and change the session_secret in .env if you want to use this in production. The current one is unsafe because it is public. You can generate a session secret using rake secret). Then run the following commands:

# Create a new heroku app
heroku create my_weblog

# Install the heroku config plugin
heroku plugins:install git://github.com/ddollar/heroku-config.git

# Pull the basic environmental variables from heroku
heroku config:pull --overwrite --interactive

# copy your .env variables to heroku
heroku config:push

# Push your app to heroku
git push heroku master

# Migrate!
heroku run rake db:migrate

You should now be able to view the weblog at http://my_weblog.herokuapp.com. Don't forget to pick a new name

In addition to private settings in the .env file, I use config/app_config.yml to store general application settings. Currently this is just the e-mail address that will be set for the 'deleted' user. This is a proxy user that will be used to assign orphaned posts to.

production:
  deleted_user_email: 'deleted@example.com' # Used for the deleted user, optional

WebL does not create an admin user by default. You can use the rails console to do this: heroku console

u = User.new(:name => "Admin", :password => "secret", :password_confirmation => "secret", :email => "webmaster@yourweblog.com")
u.roles = ['admin']
u.save

Contributing

I wrote this blog mostly for personal use, however, I welcome any improvements. If you need ideas for a small project, feel free to pick something form the list below (by no means exhaustive):

  • Password reset function
  • Improved search
  • formtastic-bootstrap or simple_form
  • better 404 errors
  • active_admin

Running tests

Because the app needs some of the environmental variables to work, I advise you to create a .env_development and a .env_test file. You can then run your app in development mode using:

foreman start -e .env_development

And you can run tests using

foreman run -e .env_test rspec spec
Something went wrong with that request. Please try again.