Ruby on Rails new Application Tutorial Set 1 with Database. Your First Rails App.
Blog App -- Specifications
Let's build a more substantial web application.
The Blog Application, usage specficiations:
--
Blog is a contraction of "weblog," a discussion or information site
published on the Web.
--
There are two types of users: the
blog administrator
and
blog users
.
--
The blog administrator should be able to enter new
postings
, typically
in reverse chronological order.
--
Users should be able to visit the blog site, and enter
comments
about
particular postings.
--
The blog administrator should be able to modify/remove any posting
or comment.
--
Users should
not
be able to modify postings or other users' comments.
Blog App -- Initial Steps
First create the rails application using:
$ rails new blog
Next, in the blog app directory, use the scaffold generator to create
the MVC components needed for posts and comments:
$ rails generate scaffold post title:string \
body:text
$ rails generate scaffold comment post_id:integer \
body:text
Now, create the post and comment database tables using:
$ rake db:migrate
Blog App -- Initial Steps
If you type:
$ rake routes
a list of all the URLs currently recognized by your application will be
provided.
Start the web server:
$ rails server
and point your browser to:
http://localhost:3000
Blog App -- Initial Steps
At this point, I'd like you to create this blog application on your own, and
demonstrate that you can perform CRUD operations on posts and
comments.
--
C
reate
--
R
ead
--
U
pdate
--
D
estroy
Sur cette page du site, vous pouvez voir la vidéo en ligne Rails Application Tutorial Set 2 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ramamoorthy P 19 mai 2014, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 213 fois et il a aimé 3 téléspectateurs. Bon visionnage!