5xruby official site
JavaScript HTML Ruby CSS CoffeeScript Shell Dockerfile
Clone or download
Latest commit 162c2cf Aug 1, 2018
Failed to load latest commit information.
app Use Redactor to edit course iframe part Jul 6, 2018
bin add webpack-dev-server Jul 13, 2017
config remove members Aug 1, 2018
db 配合行銷需求,加入特別 more_desc 欄位到 Course model,目前只會在前端 TalksController 的 show… May 17, 2018
gitlabci try to add gitlab ci with rubocop Mar 16, 2017
lib Able to export Post to middleman format Jun 26, 2018
log init May 5, 2014
public Setup sitemap for public pages Mar 13, 2018
spec fix camp_template_spec Jun 27, 2017
test/mailers/previews add mailer preview page at http://localhost:3000/rails/mailers/contac… Sep 4, 2014
vendor add react-select component Jun 7, 2017
.babelrc gem webpacker & sassc-rails Jun 6, 2017
.gitignore fix image disappear Jul 26, 2017
.gitlab-ci.yml disable rubocop for now... #102 Mar 16, 2017
.mailmap add .mailmap Sep 5, 2014
.postcssrc.yml gem webpacker & sassc-rails Jun 6, 2017
.powenv rails 4.2 與 ruby 2.3.0 Jan 4, 2016
.rspec upgrade rspec, factory_girl Oct 28, 2014
.rubocop.yml disable rubocop for now... #102 Mar 16, 2017
.ruby-version Use load Gem to generate breadcrumbs Mar 12, 2018
Capfile Setup sitemap for public pages Mar 13, 2018
Dockerfile Fix Dockerfile and docker-compose.yml missing Nov 22, 2016
Gemfile Fix vulnerability issue by upgrading Gem version Mar 26, 2018
Gemfile.lock Upgrade rails-html-sanitizer to avoid warning May 17, 2018
Procfile Change breadcrumb section in camp show page from small to starndard u… Mar 12, 2018
README.md fix /camps speaker links not responding to clicks Sep 28, 2017
Rakefile init May 5, 2014
config.ru init May 5, 2014
docker-compose.yml.example Fix Dockerfile and docker-compose.yml missing Nov 22, 2016
package.json Merge develop Jul 18, 2017
yarn.lock Merge develop Jul 18, 2017


Development Guide

Software Dependencies (OS X)

$ brew install postgres redis imagemagick@6 pkg-config


$ bundle install
$ npm install
$ cp config/application.yml.example config/application.yml
$ cp config/database.yml.example config/database.yml
$ rake db:setup dev:fake
$ rails server


  • rake dev:fake[model_name,count]

    dev:fake to generate fake data for all model, dev:fake[course,3] to create 3 fake courses (available parameters: author, post, speaker, category, course, faq)

Coding Rules

Generate Admin Pages for Models

For example, to generate admin pages for Post model:

$ rails generate model post title content:text
$ rails generate scaffold admin/post title content:text --migration=false --parent=post

Schema Updating

  1. Generate migraion file
  2. Update facotry
  3. Update _form.html.erb, show.html.erb and index.html.erb in admin pages.


Assets are managed by gistyle framework (DOM-based routing of Javascript), please follow the convension to keep your code clean. Do not mess them up with view files as much as possible.

Principle of Least Gems

Do not easily install gems unless you are familiar with them, generally, functions can be almost accomplished by Rails it self, so think twice before doing.

If you don't like the rules above, you are welcome to challenge @tonytonyjan.

Internationalization for Database Content

You can define which models and columns to be translated in Translation::AVAILABLE_MODELS, for example:

# app/models/translations
class Translation < ActiveRecord::Base
    Speaker  => [:name, :summary],
    Video    => [:title, :summary, description: :redactor],

The last element of array can be a Hahs object, keys are column names and values are form field types which correspond to columns, available valies are string (as text field), text (as text area) and redactor (as WYSIWYG editor).