plasticwrapper

design and development for the web


4 simple commands to create a rails app!

Wow.. this is crazy. Once you have rails installed, you can create a functioning web application in 4 commands:

$ rails myApplication
Runs the rails application which creates a new application directory and a ton of sub-files for the application. This is the beauty of rails. It's a framework that does a lot of the monotonous setup for you.
$ cd myApplication
Change Directory: move into the newly created rails application directory
$ script/generate scaffold myData title:string content:text
Run a script called generate, and make it build a "model" for holding your data. In this case, we're just telling it that this model consists of a title and some content. This script is going to set up a bunch of files to help us create (and manage) a database to hold our data.
$ rake db:migrate

After you perform these steps, run the script/server command. By default, this will start up your web application on port 3000. Once your rails app is running, you can access the myData model by going to: http://localhost:3000/myData.

Here, you have a basic interface to create, read, update, and delete (CRUD) your information. Voila! The rest is up to you!

Tags: , ,

Categories

Recommended Materials