データモデリング
- データと情報
- エンティティとリレーションシップ
- リソースエンティティとイベントエンティティ
- リレーションシップと多重度(カージナリティ)
- PK と AK と FK
# config/initializers/omniauth.rb | |
module OmniAuth | |
module Strategies | |
# tell OmniAuth to load our strategy | |
autoload :Pixelation, 'lib/pixelation_strategy' | |
end | |
end | |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :twitter, "app_name", "secret" |
gem 'omniauth' | |
gem 'omniauth-facebook' | |
gem 'clearance' |
module AuthHelper | |
def http_login | |
user = 'username' | |
pw = 'password' | |
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw) | |
end | |
end | |
module AuthRequestHelper | |
# |
JavaScript のための小さな FRP (Functional Reactive Programming) ライブラリです。
手続き型から関数型に切り替えることで、イベントスパゲッティのコードがクリーンで宣言スタイルの「風水の bacon」(feng shui bacon)に変わります。入れ子のループを map
と filter
のような関数型プログラミングのコンセプトに置き換えることに似ています。個別のイベントに取り組むことを止め、イベントストリームを扱います。map
と filter
でデータを変換します。merge
と combine
でデータを combine します。重火器に切り替え、上司のように flatMap
と combineTemplate
を掌握します。
このライブラリはイベントのアンダースコア( _
)です。残念なことに ~
の記号は JavaScript では認められていないからです。
資料です。
def create | |
checkout = CheckoutOrder.new current_user, params | |
checkout.subscribe(AnalyticsListener.new) | |
checkout.on(:checkout_success) do |order| | |
respond_with ... | |
end | |
checkout.on(:checkout_failed_for_one_reason) do |order| | |
do_a_thing... | |
end | |
checkout.on(:checkout_failed_for_another_reason) do |order| |
// layout file | |
<body> | |
<div class="container"> | |
<%= flash_messages %> | |
<%= yield %> | |
</div><!-- /container --> | |
</body> |
更新: | 2014-11-20 |
---|---|
バージョン: | 0.0.5 |
作者: | @voluntas |
URL: | http://voluntas.github.io/ |
概要
source 'https://rubygems.org' | |
gem 'rake' | |
gem 'lotus-router' | |
gem 'lotus-controller' | |
gem 'lotus-view' | |
group :test do | |
gem 'rspec' | |
gem 'capybara' |
# Original Rails controller and action | |
class EmployeesController < ApplicationController | |
def create | |
@employee = Employee.new(employee_params) | |
if @employee.save | |
redirect_to @employee, notice: "Employee #{@employee.name} created" | |
else | |
render :new | |
end |