-
Notifications
You must be signed in to change notification settings - Fork 0
Neo4j::Rails Scaffolds & Generators
Make sure you are running JRuby (rvm install jruby).
Creating an Neo4j application from scratch:
gem install rails rails new myapp -m http://andreasronge.github.com/neo4j/rails.rb rails generate scaffold User name:string email:string rails s
open a webbrowser: http://localhost:3000/users
The database will be stored in the db/neo4j-development
folder.
To start with a fresh new database, simply delete that folder.
See kvitter
For available commands for neo4j models:
rails generate model --help
Example: rails generate scaffold Post title:string --timestamps
Notice There are no configuration needed to create new model objects. The neo4j generate scaffold command only creates source code in the app/model
folder.
If you don’t want to use the Neo4j Project template above you can do it yourself.
Edit the config/application.rb
Replace the line require ‘rails/all’ with:
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
require 'neo4j'
Remove all references to active record in config/application.rb and config/environment/*
Add the following line to your Gemfile
gem 'neo4j', '2.0.0 or latest version'
and remove all sql gems. Install the gems specified in your Gemfile bundle install