Open kiinoo opened 12 years ago
Here are my steps, really simple:
gem 'authlogic' gem "rails-backbone" gem 'haml-rails' gem 'eventmachine', '1.0.0.beta.4.1' gem 'thin'
rails g backbone:install rails generate scaffold organization_type name:string rails generate backbone:scaffold organization_type name:string
OrganizationType.delete_all OrganizationType.create!([{name: 'department'}]) OrganizationType.create!([{name: 'workshop'}])
:javascript $(function() { window.router = new M1.Routers.OrganizationTypesRouter({organization_types: #{@organization_types.to_json.html_safe}}); Backbone.history.start(); });
the data won't show up!
Here are my steps, really simple:
rails new m1
Modify gemfile
gem 'authlogic' gem "rails-backbone" gem 'haml-rails' gem 'eventmachine', '1.0.0.beta.4.1' gem 'thin'
Run scaffold
rails g backbone:install rails generate scaffold organization_type name:string rails generate backbone:scaffold organization_type name:string
Modify model and js model: Organization
Update seeds
OrganizationType.delete_all OrganizationType.create!([{name: 'department'}]) OrganizationType.create!([{name: 'workshop'}])
Update index.html.haml as below;
organization_types
:javascript $(function() { window.router = new M1.Routers.OrganizationTypesRouter({organization_types: #{@organization_types.to_json.html_safe}}); Backbone.history.start(); });
rake db:migrate & rake db:seed
start rails and browse to http://localhost:3000/organization_types
the data won't show up!
unless I modified organization_types_router.js.coffee manually by replacing 'organizationTypes' to 'organization_types', the link worked