Section led by Ivan Lee Reachable at ivan period lee at cs period stanford period edu 1.

Slides:



Advertisements
Similar presentations
ThinkPython Ch. 10 CS104 Students o CS104 n Prof. Norman.
Advertisements

CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Python Objects and Classes
CS457 – Introduction to Information Systems Security Software 4 Elias Athanasopoulos
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.
1 Chapter 5 – Handling HTML Controls in Web Pages spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
Race Conditions Critical Sections Deker’s Algorithm.
CS 142 Lecture Notes: FormsSlide 1 Simple Form Value1: Value2:
Faculty Requisitions. Check the Schedule of Classes Go to edu edu Under “Quick-Jump” enter your.
Assignment 1 Pointers ● Be sure to use all tags properly – Don't use a tag for something it wasn't designed for – Ex. Do not use heading tags... for regular.
Python and Web Programming
CS 142 Lecture Notes: FormsSlide 1 Simple Form Value1: Value2:
Inventory Throughout this slide show there will be hyperlinks (highlighted in blue) follow the hyperlinks to navigate to the specified Topic or Figure.
Conference Planning An ACEware Webinar. Course Setup ◦Planning.. Planning.. And more Planning ◦Fee Structure Name & Reg UDF’s  (finding space to store.
Create Forms Lesson 5. Software Orientation Creating Forms A form is a database object –enter, edit, or display data from a table or query Providing.
WRA /16/13 HTML VALIDATION & HTML5. TODAY’S AGENDA Overview of new objects: lists, tables Overview of metadata: meta tags, comments History of the.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Session and cookie management in.Net Justin Brunelle CS795 6/18/2009.
CMPE 421 Parallel Computer Architecture
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
CS453: State in Web Applications (Part 1) State in General Sessions (esp. in PHP) Prof. Tom Horton.
PHP meets MySQL.
CSC 107 – Programming For Science. Announcements  Textbook available from library’s closed reserve.
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.
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 2.
Week seven CIT 354 Internet II. 2 Objectives Database_Driven User Authentication Using Cookies Session Basics Summary Homework and Project 2.
Database A database program is a piece of software to organize and sort information. It creates an electronic list of information that can be sorted very.
Photo Link Manager – Part One ► Open the Photo Link Manager form ► Understand Form Layout ► View Photos.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Photo Gallery INFO 2310: Topics in Web Design and Programming.
PHY 107 – Programming For Science. Announcements  Slides, activities, & solutions always posted to D2L  Note-taking versions before class, for those.
Creating PHPs to Insert, Update, and Delete Data CS 320.
InfoBox A Personal Information Manager Built with Ruby on Rails Dustin Martin.
New Searching Capabilities from the State Library of Kansas Searching the Kansas Library Catalog PLUS magazine, newspaper, and book databases.
GPA Calculator Project JavaScript For Web Developing CS175 – Spring 2008 Won Liu Final Project Presentation 5/20/2008.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
Bellwork Sept. 23, 2010 Copy the equations and SHOW YOUR WORK! Determine if the given numbers are solutions to the given equations. 1. x = 2 for 4 x =
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Controlling Web Site Access Using Logins CS 320. Basic Approach HTML form a php page that collects the username and password  Sends them to second PHP.
Create, Update and Delete Carol Wolf Computer Science.
MCL - 'route map' for demo1 ‘ ROUTE MAP’ MCL- demo 1. Project definition 2. ‘Main’ program definition 3. Programme 1 definition - ‘Price check’ 4. Simulator.
Programming in R Subset, Sort, and format data. In this session, I will introduce the topics: Subsetting the observations in a data frame. Sorting a data.
CS 142 Lecture Notes: FormsSlide 1 Simple Form Product: Price:
Rails and routing INFO 2310: Topics in Web Design and Programming.
Slide 1 Graphics (Characteristics 1) Images have various characteristics that affect performance Size (number of pixels) – Large images can be several.
CS 160 and CMPE/SE 131 Software Engineering February 9 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
Databases Computer Technology. First Record Last Record New Record Previous Record Current Record Next Record Working with Microsoft Access (Database)
Complete Ordering System for Promotional Literature and Samples Quick Reference and Training Guide.
Section led by Ivan Lee Reachable at ivan period lee at cs period stanford period edu 1.
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.
Today… Python Keywords. Iteration (or “Loops”!) Winter 2016CISC101 - Prof. McLeod1.
Today… Modularity, or Writing Functions. Winter 2016CISC101 - Prof. McLeod1.
Quiz 3 Topics Functions – using and writing. Lists: –operators used with lists. –keywords used with lists. –BIF’s used with lists. –list methods. Loops.
Today Encapsulation. Build a fully encapsulated Halloween class, going from Halloween1 to Halloween6 (eventually!): –The final version will have overloaded.
PHP – Hypertext Preprocessor.
FIT Testing 2 December 7, 2004.
records Database Vocabulary It can be useful to collect information.
Web Design and Development
PHP & MySQL Introduction.
ASP.NET Caching.
MVC Framework, in general.
Building Web Applications
Solving Multi-Step Inequalities
How to check out eBooks at RRHS.
Selection Statements Chapter 3.
Equations With Variables on Both Sides
Presentation transcript:

Section led by Ivan Lee Reachable at ivan period lee at cs period stanford period edu 1

{ :action => “train" } do |f| %> Name: 2

… 3

In your controller… Access using params[:ninjaTurtle][:name] Ex: If params[:ninjaTurtle][:name] == ‘turtle’ flash[:warning] = “Your turtle needs a better name!” # see how “flash” is displayed a few slides down end 4

{:action => :photoPost}, :html => { :multipart => true }) do |form| %> 5

6

You can treat it as a global variable session["login_id"] = user.id; If session["login_id"] == nil… Can store all sorts of fun stuff in the session But when you’re all done, clean up! reset_session 7

Usage if (dont_want_to_reload_page) render(:controller => turtles, :action => :attack) end Note: “:action” renders the view with the same name as the action 8

From the Rails book, pg. 397 Many forms require a user to enter some piece of information twice, the second copy acting as a confirmation that the first was not mistyped. If you use the naming convention that the second field has the name of the attribute with _confirmation appended, you can use validates_confirmation_of to check that the two fields have the same value. The second field need not be stored in the database. 9

Ex (if you really wanted to ensure the Ninja Turtle’s favorite color): class Turtle < ActiveRecord::Base validates_confirmation_of :color end 10

if = “You can’t do that!” render(:action => previousAction) return end 11

To look something up in the database by multiple fields, use Model.find(:first, :conditions => { … } ) Write out a map of what redirects where Last part: basically don’t use self.method Def method NOT Def MyClass.method or def self.method Make your layouts prettier – this helps with frustration when debugging “but it still looks so nice!” 12

13