概要
backbone-railsサンプルページの作成
詳細
backbone-railsサンプルページの作成をします。
自動生成
railsのscaffoldを実行
rails g scaffold Todo subject:string detail:string status_id:integer estimate:integer assignee:integer assigner:integer start_on:date end_on:date
rake db:migrate
backbone-railsのscaffoldを実行
rails g backbone:scaffold Todo subject:string detail:string status_id:integer estimate:integer assignee:integer assigner:integer start_on:date end_on:date
views/todos/index.html.haml編集
#todos :javascript $(function() { // Blog is the app name window.router = new BackbornSample.Routers.TodosRouter({todos: #{@todos.to_json.html_safe}}); Backbone.history.start(); });