1 Dr Alexiei Dingli Web Science Stream A ROR Twitter.

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

Mobile Bonding Accepting and parsing MMS messages.
HTML Basics and CSS style. Before we start Dreamweaver (DW) may take several minutes to start. Click on Start => Program Files => Development Apps =>
2.744 Dreamweaver Tutorial Sangmok Han Feb 24, 2010.
Cascading Style Sheets
Today CSS HTML A project.
Ruby on Rails Model of MVC. Model-View-Controller Paradigm A way of organizing a software system Benefits: Isolation of business logic from the user interface.
Starter for 10 Unit 12: Twitter Transform IT SFT12_Twitter.
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.
JavaScript and Ajax INFO 2310: Topics in Web Design and Programming.
XML and Ruby on Rails Jennifer Andrews LIS 531F April 25,2007.
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 CSE 190M, Spring 2009 Week 5. Installing Rails First, install Ruby with RubyGems Then, install the Rails gem gem install rails -version=2.3.2.
Ruby on Rails Creating a Rails Application Carol E Wolf CS396X.
Intro to Rails INFO 2310: Topics in Web Design and Programming.
Ruby on Rails (Slides modified by ements-2ed.shtml)
 What I hate about you things people often do that hurt their Web site’s chances with search engines.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Review of Last Session Search Engine Optimisation (SEO) Search Engine Optimisation (SEO) You can fine-tune your site so that the search engines notice.
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.
Authentication/Authorization INFO 2310: Topics in Web Design and Programming.
HTML & CSS A brief introduction. OUTLINE 1.What is HTML? 2.What is CSS? 3.How are they used together? 4.Troubleshooting/Common problems 5.More resources.
PHP : Hypertext Preprocessor
1 Dr Alexiei Dingli Web Science Stream Models, Views and Controllers.
Website Research By Sophie Hiscock. Fan Marvel Website You know this website is Marvel because of the characters from the comics are in the body, which.
1 Dr Alexiei Dingli Web Science Stream Helpers, Forms and Layouts.
1 Dr Alexiei Dingli Web Science Stream Advanced ROR.
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
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.
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.
Associations INFO 2310: Topics in Web Design and Programming.
1 Dr Alexiei Dingli Web Science Stream A ROR Blog.
Photo Gallery INFO 2310: Topics in Web Design and Programming.
Planning your site/organization on the Web Please use speaker notes for additional information!
Saving Form Data You can save form data in Google Spreadsheets using the following steps. 1.Create a Google Spreadsheet in your documents 2.Use Tools to.
1 Dr Alexiei Dingli Web Science Stream Web We’ll implement a voting mechanism Using AJAX Web 2.0.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
RUBY ON RAILS (RoR) Ishwor Khadka. Why Ruby on Rails?
1 Dr Alexiei Dingli Web Science Stream Assignment.
Core Publisher: Station Administrator Tools. Training 1: Site Administration Training 2: Programs Training 3: Content Tagging Training 4: Creating Posts.
Web Foundations WEDNESDAY, NOVEMBER 20, 2013 LECTURE 32: DREAMWEAVER SLIDE SHOW AND GOOGLE MAP.
PHOBOS Javascript Engine By Daniel Reeves. What is Phobos? Lightweight application framework for Java Used by NetBeans Supports multiple scripting languages.
Web Design Part I. Click Menu Site to create a new site root.
Create, Update and Delete Carol Wolf Computer Science.
Instructions for Uploading Points and Photos for Linking Uploading GPS points requires the following: At each site or transect note stop, “mark” a GPS.
CSCI 6962: Server-side Design and Programming Facelets and User Interface Design.
Introduction to Ruby&Rails Yuri Veremeyenko Monica Verma.
1 Dr Alexiei Dingli Web Science Stream Installing ROR.
Ruby on Rails Controller of MVC. Routes How we map URIs like /tweets/1 to calling the show method of the Controller.
Rails and routing INFO 2310: Topics in Web Design and Programming.
CS 160 and CMPE/SE 131 Software Engineering February 9 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
The Controller Carol Wolf Computer Science. Rails generate commands  Using the generate command, you can create a number of useful objects.  Rails:
Learning Aim C.  In this section we will look at how text, tables, forms and frames can be used in web pages.
ADVM420- Class #6 Web Design with PHP and MySQL Building a Dynamic Website: Using a database to store webcontent © Copyright 2003 Grant Macewan College.
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.
LibGuides Interface Customization Presented By: Christine Tobias ~ Kelly Sattler ~ Jenny Brandon Michigan State University Libraries.
National College of Science & Information Technology.
Agile Web Development with Rails, Chapter 11: Task F: Add a Dash of Ajax David Grayson Based on the book by Sam Ruby. Las Vegas Ruby Meetup,
CHURCH OFFICE, FORMATION OFFICE, AND MINISTRY SCHEDULER ONLINE FORMS
HTML Basics and CSS style
Bruce Scharlau, University of Aberdeen, 2017
Model – View – Controller Pattern
Chapter 15 Introduction to Rails.
CIS44.
Presentation transcript:

1 Dr Alexiei Dingli Web Science Stream A ROR Twitter

2 Create Twitter in 30 minutes... Let’s get our hands dirty!

3 What is Twitter?

4 Write a pragraph describing what you want to achieve... My web app should work in a similar way to twitter. Users should be able to register with the site and create short posts. Users should be able to follow other users. Each user should be able to see their own posts plus the users they are following. Step 1

5 Creating the application > rails twitter Step 2

6 Let’s create the basic database post model > ruby script/generate model post message:text Setup the directories > rake db:migrate Step 3

7 > ruby script/generate controller posts Step 4 Whose in control? The controller

8 The Posts controller

9 Create a partial –app\views\posts\_post.html.erb Posted ago Step 5 How shall we look at them? Through views

10 Create a view %> Step 6 How shall we look at them? Through views

11 Create a partial –app\views\posts\_message_form.html.erb Step 7 How shall we enter tweets?

12 Modify app\views\posts\index.html.erb And include at the top... "message_form" %> Step 8 Putting everything together!

13 Modify config\routes.rb And include at the bottom... Step 9 Where can I find it? Look at the routes!

14 Try it out... – ruby script/server Step 10

15 Modify the create method to accept java script files def = Post.create(:message => params[:message]) respond_to do |format| format.html { redirect_to posts_path } format.js else flash[:notice] = "Message failed to save." format.html { redirect_to posts_path } end Spicing it up with AJAX (1)

16 Modify app\views\layouts\posts.html.erb Spicing it up with AJAX (2)

17 Use the magic div tag in the index.html.erb "message_form" %> Spicing it up with AJAX (3)

18 Use the magic div tag in the _post.html.erb Posted ago Spicing it up with AJAX (4)

19 Modify the form tag in the partial _message_form.html.erb <% form_remote_tag :url => {:controller => "posts", :action => "create"} do %> Spicing it up with AJAX (5)

20 The magic of Ruby Java Script. Create a views/posts/create.rjs page.insert_html :top, :posts, :partial :highlight Spicing it up with AJAX (6)

21 How’s the spice?

22 Create in public/stylesheets a file called layout.css and paste the following layout... Ugly duckling? Use some CSS

23 In the header of the app/views/layouts/posts.html.erb add Activate the CSS

24 Voila!

25 Questions?