Populate data

Hello guys,

Let’s take a look below situations:

  • During development mode many times we run command “rake db:migrate VERSION=0” (so all data will be lost!)
  • Our rails application is ready to run and we give it someone to test it. (without data???)
  • Client wants that developer will test on his test data so both can understand it very well. (will developer enter data manually?)

In above all situations we want development data again(of course easily! ). How can we get it? There are some options for this given below:

Seeds is nice option but it will be boring to write all data and populator and faker gem will populate fake data not development data.

So now what to do?

Let’s introduce yaml_db!!!

It’s very easy to use.

  • Install yaml_db as a plugin or gem
  • If you want to give your development data to someone else then run command “rake db:data:dump”
  • This command will create one file named “data.yml” at RAILS_ROOT/db folder. This file contains your all development data.
  • Now if someone wants to use this file then user will put this file at above location and will run command “rake db:data:load”
  • So development database will populate with all data and that’s it!

Isn’t it simple then you thought?

Rails API Offline???

Have you ever think or have you find youself in a condition that you want to use Rails API but net is down or http://api.rubyonrails.org/ is not working!!!

Well than cheers!!!

because now you can get latest Rails API offline.

How???

Just follow the below steps:

Go to  http://railsapi.com/ and Download the zip file.

Extract it and open index.html file in your favourite browser.

It gives API with awsome CSS and fine search functionality.

So, that’s it!!!

So what are you waiting for?

Go and download the API before your net will go down.

Learn rails online at it’s best way

Good news for people who want to learn RoR online(ofcourse free ;))

DHH Team create a seprate site for rais aspirants.

follow this link: http://guides.rails.info

Ready?????

Goooooooo…..!!!!!!!!!!