Generate a new Rails project. Skip unit tests and bundle install.
rails new -T -B tdd
var gulp = require('gulp'); | |
var fs = require('fs'); | |
var plugins = require('gulp-load-plugins')(); | |
var es = require('event-stream'); | |
var del = require('del'); | |
var historyApiFallback = require('connect-history-api-fallback'); | |
var vendor = require('./vendor/manifest'); | |
var paths = { |
# Add the Will Paginate plugin to the gemfile | |
gem 'will_paginate', '3.0.pre2' | |
# Place this code in the controller | |
@items = Item.all.paginate(:page => params[:page] || 1, :per_page => 10) | |
# Place this code in the view | |
<%= will_paginate @items %> |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Your Website</title> | |
</head> | |
<body> |
require 'rbconfig' | |
host_os = RbConfig::CONFIG['host_os'] | |
if host_os ~= /mac|darwin/i | |
# Mac | |
elsif host_os ~= /bsd/i | |
# BSD | |
elsif host_os ~= /solaris|sunos/i | |
# Solaris | |
elsif host_os ~= /linux/i |
// This example was summarized from http://www.playframework.org/documentation/1.2/validation and | |
// reproduced here for quick reference. | |
// To achieve model-level validations (versus handling at controller level), first annotate | |
// the properties of the model. | |
package models; | |
public class User { | |
# The current configuration for CarrierWave | |
CarrierWave.configure do |config| | |
config.storage = :s3 | |
config.s3_access_policy = :public_read | |
config.s3_access_key_id = S3_CONFIG['access_key_id'] | |
config.s3_secret_access_key = S3_CONFIG['secret_access_key'] | |
config.s3_bucket = S3_CONFIG['bucket'] | |
end |
Octal Text Binary Description | |
============================================================= | |
0 --- 000 All types of access are denied | |
1 --x 001 Execute access is allowed only | |
2 -w- 010 Write access is allowed only | |
3 -wx 011 Write and execute access are allowed | |
4 r-- 100 Read access is allowed only | |
5 r-x 101 Read and execute access are allowed | |
6 rw- 110 Read and write access are allowed | |
7 rwx 111 Everything is allowed |
curl -v -H "Content-Type: application/json" -X POST -d '{"title":"Hello World"}' http://localhost:3000/notes |