Exercises, examples and other material relating to training module R114. This topic is presented on public courses Learning to program in Ruby
, Ruby Programming
|Articles and tips on this subject||updated|
|4502||Reading and parsing a JSON object in Ruby|
Here's a series of three new examples, building up from one another, showing the reading of a JSON feed from a remote web site in Ruby, and the analysis and presentation of that data.
The first example - [here] - shows the loading of extra modules to handle reading from the web and the JSON format, ...
|4003||Web and console - same principle, same code - Ruby example|
Courses for newcomers to programming start with showing the mechanism of how to enter a program, how to prepare that program to be run, and how to actually run it. We then show them how to read an input (usually from the keyboard), calculate, save values into variables and resuse them a few lines later, ...
|2605||Ruby on Rails - a sample application to teach you how|
The Ruby on Rails Framework is a great way to put bolt web applications together quickly - but it can be overwhelming when you come to do it for the first time. There's a steep learning curve with all the various elements to put together to make up the whole.
We have a first (tiny!) demonstration in ...
|3773||Ruby on the web - a simple example using CGI|
I've added a CGI example in Ruby - as part of the Ruby training I was doing yesterday. Source code is [here] to show how it works / "Proof of concept". In practise, I would use the cgi module in Ruby if I was doing server side work using CGI - "Hello World" using that module is [here], or if ...
|3623||Some TestWise examples - helping use Ruby code to check your web site operation|
How to test your website and browser based applications? In a previous article I covered watir-webdriver which lets you run the Firefox Browser from a Ruby script, passing in instructions as to what to fill into certain fields, and then lets you check with all the power of Ruby the pages that are returned ...
|3432||3 digit HTTP status codes - what are they, which are most common, which should be a concern?|
We often talk during web related course / course modules about the status codes that are returned by servers - but I don't think I've ever written up a (near?) complete list. They are all three digit codes, and they're grouped by hundreds - so 200 series code are success, 400 codes are requests that ...
|3431||Ruby at both extremes of your website|
Q: How is Ruby used on the web?
A: At both extremes.
Here's a web server ... serving documents and programs (on the right) to browsers (on the left).
On the server, here is Ruby on a Rails Framework on the right. Requests to the Web Server are passed to the routing section of Rails, then routed ...
|2607||Answers on Ruby on Rails|
What is Ruby on Rails?
Ruby on Rails is a clever way of programming your web server in Ruby - it allows you to have data in databases on your website and provide very easy access tothat data through a browser, allowing your customers to see the data and you staff to see it, alter it, and add more data ...
|1891||Ruby to access web services|
If you want to use a Ruby program to access an RSS feed (or some other XML or HTML data), you can start with the standard Net::HTTP module ... full (working, tested) example here. That example "just" uses a Get method to get an RSS feed of the latest posts to the First Great Western Coffee Shop Forum ...
Examples from our training material
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from [here]
Topics covered in this module
CGI and the Ruby Apache Module.
Using cgi.rb; URL decoding, forms, sessions, cookies, etc.
Embedding Ruby in HTML - the <% <%= and <%# tags.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.