Jinda

Rails Application Generator using Freemind

Additional Extension themes also available at

Prerequisites

These versions works for sure but others may do.

Convention

Sample Application

Supposed we want to create ecommerce web site, first create a Rails app without ActiveRecord

$ rails new YOURAPP -BOTJ

Add jinda to your Gemfile:

gem 'jinda', '~> 0.5.3'

For Development (most updated)

gem 'jinda', github:'kul1/jinda'

depend on your operating system, you may need to uncomment

gem 'therubyracer', :platforms => :ruby

install gems

$ bundle

generate jinda application

$ rails generate jinda:install

Then run bundle again to install additional gems added by jinda

$ bundle

(or run all with "sh install.sh" )

configure mongoid, omniauth

$ rails generate jinda:config

Please make sure mongod is running then create admin user

$ rails jinda:seed

now the application is ready, start it as any Rails application

$ rails server

go to localhost:3000, click Sign In on the left menu, and enter user name admin and password secret

Now open file app/jinda/index.mm using Freemind

The 3 main branches are

models

Fiirst, we need to create some product so we click on models we'll see 2 models person and address. These are sample only. You can delete them or modify them however you want. We'll take a look at them first

The first sub branch (e.g. person) is the model name. According to Rails convention, this should be a singular word. The next sub branch are columns in the database. Let's take a look at each:

In this example we just want a product model, so delete the person and address model and add a product branch like so

Save the mind map then run:

rake jinda:update

This will create file app/models/product.rb. In this file, note the comment lines # jinda begin and # jinda end. Everything inside these comments will get overwritten when you change the models branch in the mind map so if you need to put anything inside here, use the mind map instead. You can add anything outside these comment lines which will be preserved when doing jinda:update.

services

Next we'll add some product into the database, we'll first take a look at the services branch, which already has 3 sub branches; users, admins, and devs. Unlike models person and address branches, these branches are actively used by the system so I recommend that you leave them alone. Let's open the users branch

The text users:User on the sub branch has these implications:

The next sub branches has the following:

Armed with this knowledge, we are ready to add new product into our application like so:

To generate controller and views we save this mind map and run

rake jinda:update

open file app/views/products/add/enter.html.erb you'll see some sample view already in there but commented. edit the file so it look like this

Note that we do not specify form_tag and submit_tag, these will be supplied by Jinda.

then open file app/controllers/products_controller.rb and add create method as follow. The method name has to be correspond to the branch.

Testing

run following command:

rails generate jinda:rspec
guard init
guard

Contributing

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am 'Add some feature')

  4. Push to the branch (git push origin my-new-feature)

  5. Create new Pull Request