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.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Introduction to Rails.
How to register to access the members only pages on our website 1. Scroll down to the bottom of the home page and click on the text (arrowed)
Mobile Bonding Accepting and parsing MMS messages.
The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
PHP and MySQL Database. Connecting to MySQL Note: you need to make sure that you have MySQL software properly installed on your computer before you attempt.
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
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.
Enquiry Progress Give your vendor code In case of incorrect vendor code / no id registered with us, you will get this error message In case of correct.
DIMES Planner The DIMES Project Tel Aviv University October-2010.
Overseas Library Catalog – Request Item Overseas Library Catalog Request loaned item.
CS 683 Emerging Technologies Fall Semester, 2005 Doc 21 Rails Intro Nov 10, 2005 Copyright ©, All rights reserved SDSU & Roger Whitney, 5500 Campanile.
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.
Lecture 4: Introduction to PHP 3 PHP & MySQL
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:
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.
Copyright © ASC Associates All Rights Reserved. MUST Pack And Go Migration Demonstration Upsizing an Access back-end and re-linking an Access front-end.
Ruby on Rails Creating a Rails Application Carol E Wolf CS396X.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
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. What is Ruby on Rails? Ruby on Rails is an open source full-stack web framework. It is an alternative to PHP/MySQL. It can render templates,
Ruby on Rails CSCI 6314 David Gaspar Jennifer Garcia Avila.
Novus HR Application Review Process Human Resources Qualifying Applications HR Sending Applications to Department/Search CommitteeHR Sending Applications.
PHP Security.
1 Dr Alexiei Dingli Web Science Stream Models, Views and Controllers.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Recruitment Office Procedures Job Posting Requests Creating a Search Committee –Adding Search Committee MembersAdding Search Committee Members –Designating.
Lecture 7 Interaction. Topics Implementing data flows An internet solution Transactions in MySQL 4-tier systems – business rule/presentation separation.
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
WaveMaker Visual AJAX Studio 4.0 Training Authentication.
Students are able to generate a one-time login through their VTAC User Account.  The login details will need to be forwarded to the person nominated to.
MVC & ActiveRecord by Christian Mohr & Mohamed Souiai.
Eurotrace Hands-On The Eurotrace File System. 2 The Eurotrace file system Under MS ACCESS EUROTRACE generates several different files when you create.
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.
Installing and Using MySQL and phpMyAdmin. Last Time... Installing Apache server Installing PHP Running basic PHP scripts on the server Not necessary.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Week seven CIT 354 Internet II. 2 Objectives Database_Driven User Authentication Using Cookies Session Basics Summary Homework and Project 2.
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.
The Active Record Paradigm Databases in Database-Centric Web Site Development.
Associations INFO 2310: Topics in Web Design and Programming.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
1 Dr Alexiei Dingli Web Science Stream A ROR Twitter.
ARMS® Automotive Stop Button. ARMS® Auto Stop Button  Screen shot as user first enters vehicle detail page »Quick link appears on right side of page.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
Chapter 15 © 2013 by Pearson Overview of Rails - Rails is a development framework for Web-based applications - Based on MVC architecture for applications.
Go to your Blog URL: Then click on “Log in” Your students do not need to remember their password, they can select.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Class 3Intro to Databases Class 4 Simple Example of a Database We’re going to build a simple example of a database, which will allow us to register users.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Our MP3 Search Engine Crawler –Searching for Artist Name –Searching for Song Title Website Difficulties Looking Back.
ASSIGNMENT 2 Salim Malakouti. Ticketing Website  User submits tickets  Admins answer tickets or take appropriate actions.
The Controller Carol Wolf Computer Science. Rails generate commands  Using the generate command, you can create a number of useful objects.  Rails:
Log In Information Address – the one you used to register Temporary Default Password is (case sensitive)
CS 160 and CMPE/SE 131 Software Engineering February 11 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
Ruby on Rails. Web Framework for Ruby Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller –almost.
Logging On – to Rotary databases Two Distinct Resources – Club Website & Database Referred to often as ClubRunner – Rotary International.
CIS Host Manager Bryce Johnston CIS 597 May 8, 2009.
Rails web application framework that uses Ruby as its programming language builds skeleton applications for you applications come with lots of defaults.
Database application MySQL Database and PhpMyAdmin
PHP / MySQL Introduction
My EBSCOhost Tutorial Tutorial support.ebsco.com.
Rails 11-Nov-18.
Chapter 15 Introduction to Rails.
Project OSCAR Main Page
1. To register in the system, the educator will click on the NCDPI Registration link on the log-in page.
1. To register in the system, the educator will click on the NCDPI Registration link on the log-in page.
Presentation transcript:

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 cars

Go to cars dir and type: ruby script/generate controller main C:\InstantRails\rails_apps>mkdir car_app C:\InstantRails\rails_apps>cd car_app C:\InstantRails\rails_apps\car_app>rails cars create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create components create db create doc create lib create lib/tasks … C:\InstantRails\rails_apps\car_app>cd cars C:\InstantRails\rails_apps\car_app\cars>ruby script/generate controller main exists app/controllers/ exists app/helpers/ create app/views/main exists test/functional/ create app/controllers/main_controller.rb create test/functional/main_controller_test.rb create app/helpers/main_helper.rb C:\InstantRails\rails_apps\car_app\cars>

Building tables I used phpmyadmin to build the tables. The text uses scripts in mysql to generate the tables.

main/welcome

Requesting all coupes from 1970 to 2005

Source files for cars app (with little guidance on where to put them)

Where to put the files Put controllers in controllers Put rhtml (or directories with display.rhtml) in views Models dir 

controllers

views

Create a new database, cars_development

Phpmyadmin from rails

Looking at a table

An app dir in a rails application

Trying to register to be a member returns “user created” if no errors

User “secretariat” created

Secretariat in db

So what all is in this app?

application.rb # Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base # Pick a unique cookie name to distinguish our session data from others' session :session_key => '_rail_space_session_id' end

site_controller class SiteController < ApplicationController def to 'My' RailSpace!" end def 'My' RailSpace!" end def for 'My' RailSpace!" end

user_controller class UserController < ApplicationController def index end def = "Register" if = User.new(params[:user]) render :text => "User created!" end

app/models- users.rb in notes

App/views/user

register.rhtml Register Enter Your Details Screen name: <%= form.text_field :screen_name, :size => User::SCREEN_NAME_SIZE, :maxlength => User::SCREEN_NAME_MAX_LENGTH %> <%= form.text_field : , :size => User:: _SIZE, :maxlength => User:: _MAX_LENGTH %> Password: <%= form.password_field :password, :size => User::PASSWORD_SIZE, :maxlength => User::PASSWORD_MAX_LENGTH %> "submit" %>

login.rhtml Log in Enter Your Details Screen name: <%= form.text_field :screen_name, :size => User::SCREEN_NAME_SIZE, :maxlength => User::SCREEN_NAME_MAX_LENGTH %> Password: <%= form.password_field :password, :size => User::PASSWORD_SIZE, :maxlength => User::PASSWORD_MAX_LENGTH %> "submit" %> Not a member? "register" %>

Now…logging in

And then…