creating rails app n.
Skip this Video
Loading SlideShow in 5 Seconds..
Creating rails app PowerPoint Presentation
Download Presentation
Creating rails app

Loading in 2 Seconds...

play fullscreen
1 / 11

Creating rails app - PowerPoint PPT Presentation

  • Uploaded on

Creating rails app. p :InstantRailsrails_apps>rails -d mysql cars create create app/controllers create app/helpers create app/models create app/views/layouts create config /environments create config /initializers create db create doc create lib

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

Creating rails app

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

p:\InstantRails\rails_apps>rails -d mysql cars


create app/controllers

create app/helpers

create app/models

create app/views/layouts

create config/environments

create config/initializers

create db

create doc

create lib

create lib/tasks

create log

change to cars dir
Change to cars dir

P:\InstantRails\rails_apps>cd cars

P:\InstantRails\rails_apps\cars>rake db:create:all

(in P:/InstantRails/rails_apps/cars)

P:\InstantRails\rails_apps\cars>ruby script/generate scaffold Corvette body_styl

e:string miles:floatyear:integer

exists app/models/

exists app/controllers/

exists app/helpers/

create app/views/corvettes

exists app/views/layouts/

exists test/functional/

exists test/unit/

create app/views/corvettes/index.html.erb


instantrails r ailsapps cars db migrate 001 create corvettes rb

class CreateCorvettes < ActiveRecord::Migration


create_table :corvettes do |t|

t.string :body_style

t.float :miles

t.integer :year





drop_table :corvettes



create db by running migrate
Create db by running migrate

P:\InstantRails\rails_apps\cars>rake db:migrate

(in P:/InstantRails/rails_apps/cars)

== 1 CreateCorvettes: migrating ===============================================

-- create_table(:corvettes)

-> 0.0780s

== 1 CreateCorvettes: migrated (0.0780s) ======================================

run server from p drive it is all very slow
Run server… from p drive it is all very slow

P:\InstantRails\rails_apps\cars>ruby script/server

=> Booting Mongrel (use 'script/server webrick' to force WEBrick)

=> Rails application starting on

=> Call with -d to detach

=> Ctrl-C to shutdown server

** Starting Mongrel listening at

** Starting Rails with development environment...

app models corvette rb adding validation
App/models/corvette.rb --- adding validation

class Corvette < ActiveRecord::Base

validates_presence_of :body_style, :miles, :year

validates_numericality_of :year, :greater_than=>1952, :less_than_or_equal_to=>