Ruby on Rails CSE 190M, Spring 2009 Week 7. Customizing Our Views In our blog example, our entries were ordered from oldest to newest We can order them.

Slides:



Advertisements
Similar presentations
Selected Topics Dr Yi Zhou
Advertisements

© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
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.
Downloading, Installing, and Working with Dropbox.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
BUILD & PUBLISH A WEBSITE Introduction. WORDPRESS It is a Blogging software, like an online diary Take away the Blogging part and it as a simple CMS (Content.
INSTALLATION OF WORDPRESS. WORDPRESS WordPress is an open source CMS, often used as a blog publishing application powered by PHP and MySQL. It has many.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
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.
5 Days Open Source Workshop Zencart – Wordpress – Joomla Welcome Day 3.
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.
Introductory CMS Training Welcome to the new Montana State University Content Management System!
Agenda – Week 5, Day 2 Complete RoboHelp Tutorial Transition to HTML Tutorial –Warm-up – Explore HTML –Page Design – Create a page –Publishing – Make your.
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.
Submitted To: Mr. Michael Verana  ‘From “Web log.” A blog is basically a journal that is available on the web. The activity of updating a blog is.
Ruby on Rails (Slides modified by ements-2ed.shtml)
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
By Jeerarat Boonyanit. As you can see I have chosen Cpanel for my server management tool. cPanel is a Linux based web hosting control panel that provides.
RUBY ON RAILS Mark Zhang. In this talk  Overview of Ruby on Rails  Core ideas  Show a tiny bit of example code  Touch on several general web development/
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,
August 25, SSO with Microsoft Active Directory Presented by: Craig Larrabee.
Introduction to. What is Office 365 Office 365 is the same Office you already know and use every day. Office 365 is powered by “the cloud” which is a.
Installing CiviCRM onto Wordpress. How does it work?
Getting Started with GIT. Basic Navigation cd means change directory cd.. moves you up a level cd dir_name moves you to the folder named dir_name A dot.
ZFApp Preview Walkthrough. What is ZFApp? ZFApp is an application framework built on top of Zend Framework Fully compatible with the latest ZF Versions.
WordPress Web. WordPress Blogging system with full content management Personal publishing system Built on PHP scripting language and MySQL relational.
Rails and Grails. To get started Make sure you have java installed You can get the sdk and jre at:
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Eclipse Overview Introduction to Web Programming Kirkwood Continuing Education Fred McClurg © Copyright 2015, Fred McClurg, All Rights Reserved.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Putting Applets into Web Pages.  Two things are involved in the process of putting applets onto web pages ◦ The.class files of the applet ◦ The html.
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.
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.
Dreamweaver MX. 2 Overview of Templates n Templates represent a web page design or _______ that will be common to multiple pages. n There are two situations.
The Active Record Paradigm Databases in Database-Centric Web Site Development.
Ruby on Rails (Slides modified by ements-2ed.shtml)
Associations INFO 2310: Topics in Web Design and Programming.
Photo Gallery INFO 2310: Topics in Web Design and Programming.
CSE 154 LECTURE 5: INTRO TO PHP. URLs and web servers usually when you type a URL in your browser: your computer looks up the.
Webview and Web services. Web Apps You can make your web content available to users in two ways in a traditional web browser in an Android application,
Setting Up your Hosting Account and Installing WordPress and Omeka CCC America Advanced Omeka Training.
Solutions using Microsoft Content Management Server 2002 Connector for SharePoint Technologies Sue Corke Mark Harrison Microsoft UK.
Table of Contents TopicSlide Administrator Login 2 Administrator Navigations 3 Managing AlternativeDr.com Blogs 4 Managing Dr. Lloyd May Blogs 5 Managing.
WAMP Windows Apache MySQL and PHP i.e. “WAMP”. Why WAMP? WampServer is a Windows web development environment. It allows you to create and test web pages.
Creating Google Sites Laura Assem, Director of Technology.
WHAT IS SERVER SIDE SCRIPTING? Server-side scripting is a web server technology in which a user's request is verified by running a script directly on the.
Lecture 13b Rails – Controllers and Views Topics SaaSSaaS Readings: SaaS book Ch March 3, 2014 CSCE 740 Software Engineering.
Setting up Dreamweaver to use your local WAMP testing Server
1 Dr Alexiei Dingli Web Science Stream Installing ROR.
Adxstudio Portals Training
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
Class03 Introduction to Web Development (Hierarchy and the IDE) MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University.
Intro to APACHE, MySQL, and PHP & freely available (hackable) Packages Aonghus Sugrue 04 Oct 2012.
Navigating the Course 1. Course Materials 2 Software: Notepad (or TextEdit on a Mac) – comes with operating system Internet Explorer Web Browser FireFox.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
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.
Google App Engine using Java 1. Outline Getting started Guestbook example Todo example Simplified Madlib 2.
Here are some things you can do while you wait 1.Open your omeka.net site in your browser (e.g. 2.Open.
1 Rails for the Ruby-Impaired John Paul Ashenfelter CTO/Transitionpoint.
NX Documentation Using Windows IIS (Internet Information Services) as a http server for NX documentation.
Reactor An ORM framework for ColdFusion Presentation By: Doug Hughes
Installing and Configuring Moodle. Download Download latest Windows Install package from Moodle.orgMoodle.org.
Google App Engine using Java 1. Outline Getting started Guestbook example Todo example Simplified Madlib 2.
Using the Personal Image Photo Library
TurnKey Lunch and Learn: ALM/UFT Best Practices
Introduction to Web Development (Part 2)
Introduction of FrontPage
Wordpress test.cs.edinboro.edu.
Presentation transcript:

Ruby on Rails CSE 190M, Spring 2009 Week 7

Customizing Our Views In our blog example, our entries were ordered from oldest to newest We can order them newest to oldest if we = Entry.all.reverse! Maybe we only want to show the 5 most recent = Entry.all.reverse!.slice(0,4)

Adding Additional Views Last week we showed how Scaffold generates a bunch of standard views and a template layout If we wanted additional actions we: – Add the action in our controller – Create the corresponding view – Update our routes.rb file map.resources :obj_plural => { :action => method } e.g. map.resources :entries => { :preview => get }

Templates with Layouts Scaffold creates a Layout that works as a template for our objects layouts/entries.html.erb This template displays the same thing for each of the actions for that object, and then yields to the corresponding view to display the unique content If we want, we can make one single template to be used by all objects by making one named "layouts/application.html.erb"

Partial Layouts Sometimes we may want the same bit of code to show up in multiple templates (e.g. navigation bar) We can display partial pages in our templates or views, and they are called "partials" Partials can be in any of the views or layouts folders By convention, they start with an underscore views/layouts/_top_nav.html.erb We can render our partial in a template wherever we want it to be displayed "layouts/top_nav" ) %>

Rails on Webster In your public_html directory, make a folder for your Ruby apps /home/rctucker/ruby_apps Create your Rails app in this folder rails –d mysql my_app In your public_html folder, make a symlink from the public folder of your app to a folder with the name of your app ln -s ruby_apps/my_app/public my_app Create/modify.htaccess file in your public_html folder. Add the following line (using your username and application name instead) RailsBaseURI /rctucker/my_app Add the following line to your environment.rb file config.action_controller.relative_url_root = "/rctucker/my_app" Restart your app touch my_app/tmp/restart.txt View app at webster.cs.washington.edu/username/app_name

"Restarting" Your Rails App Instead of using WEBrick, we are using a plugin so that Apache can run your Rails apps Unlike when you run your application locally, when your application is on Webster, it is always running If you make changes to your app that require you to restart it (such as changes to routes.rb or anything else in the config folder) you must restart your application Restart your app on Webster by modifying a file named restart.txt in your tmp folder touch my_app/tmp/restart.txt

Other Resources At the end of the quarter, Webster will disappear, but… As students, you have web space on a server called Dante through your UW accounts – dante.u.washington.edu Dante already has Ruby and Rails installed for you (MySQL is not installed) You can find documentation on how to get your Rails applications up and running on Dante here: