node.js / npm / yeoman をinstall
$ npm install -g backbone
// sample | |
var MyView = Marionette.ItemView.extend({ | |
template: "my-template-id" | |
}); | |
var myView = new MyView({ model: Dog}); | |
myView.render(); | |
// ItemView sample |
jasmine rails
https://github.com/searls/jasmine-rails
railsでjasmine使うためのgem。
coffeeでも書ける。
# omniauth + omniauth-twitter gems are required | |
class TwitterApi | |
SITE = "http://api.twitter.com" | |
API_URL = { :update_status => SITE + "/1.1/statuses/update.json"} | |
def self.feed | |
access_token = official_access_token | |
response = access_token.request(:post, | |
API_URL[:update_status], |
# railsのmodelで***_path(resourceのURL)を使う方法 | |
- Rails.application.routes.url_helpers.posts_path | |
- 参考 | |
- http://stackoverflow.com/questions/5380703/rails-get-resource-path-in-model | |
- ところが、これだと、パスしか分からない。URLのホスト部分が入らない。 | |
- posts_urlに変えると、以下のエラーが出る。 | |
- ArgumentError (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true): |
よく忘れてしまうので、mysqlのuser系のコマンドのまとめ
ユーザー作成
create user 'username'@'host'
ユーザー変更
rename user old to new
ユーザー一覧
select Host,User from mysql.user;