Creating rails app. p:\InstantRails\rails_apps>rails -d mysql cars create create app/controllers create app/helpers create app/models create app/views/layouts.

Slides:



Advertisements
Similar presentations
Chapter 15 © 2010 by Addison Wesley Longman, Inc Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in Use spread rapidly.
Advertisements

Trestle Generator Industrial-strength scaffolding for Ruby on Rails web application development.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
1 JRuby on Rails GAO ANG Sun Functional Campus Ambassador 1.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
CS 683 Emerging Technologies Fall Semester, 2005 Doc 21 Rails Intro Nov 10, 2005 Copyright ©, All rights reserved SDSU & Roger Whitney, 5500 Campanile.
CS 683 Emerging Technologies Fall Semester, 2005 Doc 23 Rails Model Example Nov 17, 2005 Copyright ©, All rights reserved SDSU & Roger Whitney, 5500.
Ruby on rails This ppt contains a pot pourri of information including some sql, some php, some instant rails and so on.
24-Jun-15 Rails. What is Rails? Rails is a framework for building web applications This involves: Getting information from the user (client), using HTML.
Methods for Rails. File Structures This is taken directly from app Holds all the code that's specific.
27-Jun-15 Rails. What is Rails? Rails is a framework for building web applications This involves: Getting information from the user (client), using HTML.
A complete ror application. Some easy tutorials This uses oracle but it is easy to replace that with mysql:
Rails Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce.
Creating a wiki blog. Run apps that come with instant rails distribution select I /rails applications/open ruby console window Cd to cookbook or typo.
Ruby on Rails Creating a Rails Application Carol E Wolf CS396X.
 2008 Pearson Education, Inc. All rights reserved Ruby on Rails.
Irma & Robert. Irma & Robert  Ruby on Rails is an open source web application framework for the Ruby programming language. It is often referred to as.
Intro to Rails INFO 2310: Topics in Web Design and Programming.
Ruby on Rails: An Introduction JA-SIG Summer Conference 2007 Michael Irion The University of Tulsa.
RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions.
Authentication/Authorization INFO 2310: Topics in Web Design and Programming.
Rails and Grails. To get started Make sure you have java installed You can get the sdk and jre at:
Deploying Ruby on Rails How to make your application actually serve Dan Buettner 18 Oct 2007.
1 Dr Alexiei Dingli Web Science Stream Models, Views and Controllers.
Taking ActiveRecord to the Next Level Blythe Dunham
Ruby on Rails Your first app. Rails files app/ Contains the controllers, models, views and assets for your application. You’ll focus on this folder for.
COM531 Multimedia Technologies
Ruby on Rails CSE 190M, Spring 2009 Week 6. Overview How to use a database Demo creating a blog application on Rails Explain how the application works.
© Copyright IBM Corporation 2007 AP/Americas April 15-18, 2007 Anaheim, California Introduction to RubyOnRails - a J2EE replacement? Russell Scheerer –
The Active Record Paradigm Databases in Database-Centric Web Site Development.
Associations INFO 2310: Topics in Web Design and Programming.
1 Dr Alexiei Dingli Web Science Stream A ROR Blog.
Chapter 15 © 2009 by Addison Wesley Longman, Inc Overview of Rails - Rails is a development framework for Web-based applications - Rails is written.
Ruby on Rails vs ASP.NET MVC Simone Chiaretta Web Architect, Council of the EU Milano, 19 Febbraio 2011 Sandro.
Ruby on Rails on Oracle Hoon Lee Department of Logistics Information Technology.
Photo Gallery INFO 2310: Topics in Web Design and Programming.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
1 Dr Alexiei Dingli Web Science Stream Web We’ll implement a voting mechanism Using AJAX Web 2.0.
RUBY ON RAILS (RoR) Ishwor Khadka. Why Ruby on Rails?
Chapter 15 © 2013 by Pearson Overview of Rails - Rails is a development framework for Web-based applications - Based on MVC architecture for applications.
1 Migration. 2 What’s Migration? Migration –Isolates database differences Allows you to write schema updates without worries about differences –Helps.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
Ruby on Rails+MySQL. Sebesta corvette example In rails_apps create a directory (car_app), change to this dir and run rails (rails cars) Rails_apps Car_app.
Introduction to Ruby&Rails Yuri Veremeyenko Monica Verma.
1 Dr Alexiei Dingli Web Science Stream Installing ROR.
Adding Data to a Database Table Carol Wolf Computer Science.
Ruby on Rails & Databases. Active Record Active Record in Rails CRUD & Other Stuff Mapping Cardinalities Migrations Demo.
CS 160 and CMPE/SE 131 Software Engineering February 9 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
Introduction to information systems RUBY ON RAILS dr inż. Tomasz Pieciukiewicz.
Migrations Carol Wolf CS 396X. ISBNTitleAuthorImage EmmaAustenemma.jpg Oliver TwistDickenstwist.jpg HamletShakespearehamlet.jpg.
Advanced Migration By Aye Mon Tun.  To change database schema in consistent and easy way  In ruby code Migration? 11/25/2013 2Web Application Engineering.
SEG4110 – Advanced Software Design and Reengineering TOPIC N Ruby on Rails.
JRuby on Rails Presenter Name
Melbourne LUG Presentation Learning Rails and Ruby - making webapps easier.
JRuby on Rails Brian Leonard ブライアン レオナルド
Mid-Hudson Valley Linux Users Group Ruby on Rails Web Development is Fun Again MHVLUG Meeting Jan 7 th 2009 Sean Dague sean.dague.net.
CMPE/SE 131 Software Engineering September 1 Class Meeting Department of Computer Engineering San José State University Fall 2016 Instructor: Ron Mak
Data Modeling.
Introduction to RoR Ruby on Rails
Rails web application framework that uses Ruby as its programming language builds skeleton applications for you applications come with lots of defaults.
Introduction to RoR Ruby on Rails
Ruby on Rails Model of MVC
Rails 11-Nov-18.
Agile Web Development with Ruby and Rails
Model for Student Table
Chapter 15 Introduction to Rails.
Model for Student Table
CMPE/SE 131 Software Engineering February 2 Class Meeting
Presentation transcript:

Creating rails app

p:\InstantRails\rails_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 create lib/tasks create log

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:float year: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 ….(more)

Instantrails/railsapps/cars/db/migrate/ 001_create_corvettes.rb class CreateCorvettes < ActiveRecord::Migration def self.up create_table :corvettes do |t| t.string :body_style t.float :miles t.integer :year t.timestamps end def self.down drop_table :corvettes end

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) -> s == 1 CreateCorvettes: migrated (0.0780s) ======================================

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 :3000 ** Starting Rails with development environment...

Startup screen

Form to create new car

After creating a car

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=>Time.now.year end

Entering bad content