Home | Contact Us | Log In | Help
HOME NEW LISTING MOST POPULAR HIGHEST RATED SCRIPTS ADD SCRIPT DOWNLOADS FORUM
Tutorials
  ASP.Net & C#
  ASP
  Perl and PHP
  Java Scripts
  C and C++
  Ajax Tutorials
  J2ee, J2Me, Java
  Python & Ruby Rail
  Crystal Report
  Sap
  CGI
  XML
  Cold Fusion & CFML
  HTML, DHTML & CSS
  Dreamweaver
  FLASH
  Photoshop/Web Designing
  Tools & Utilities
  Oracle/D2K
  Sql Server
  MySql
  Domain Name Registration
  Remotely Hosting
  Web/Server Application
  Hotel Marketing
  Internet and Law
   Search Engine Optimization/SEO
E-Commerce
Interview Questions
Previous< 13 14 15 16 17 18 19 20 21 > Next
PYTHON & RUBY RAIL 17
Mongrel

Mongrel is a fast, stand-alone HTTP library and server for Ruby. It allows you to run your Rails applications without having to compile or use other applications (like FastCGI, SCGI, LightTPD, or Apache).

Even better, Mongrel is also a gem. Type this command

Flash Remoting for Rails Tutorial

Ever since I've been using Rails I've missed one important tool from my webdev toolbox, Flash Remoting. I've been getting by with XML but it's just not the same and it changes the way you approach things ("If all you have is a hammer everything looks like a nail"). Remoting can pass objects, arrays, strings etc. straight to Flash as native data types which avoids XML sit-ups (as the Rails folk would say). Remoting uses AMF (Active Message Format) which comes across as bytes so it's faster than XML. Yesterday my prayers where answered as the Midnight Coders released WebORB for Ruby on Rails.

Ruby On Rails Application

OK, without more ado, let’s start programming with Rails. Before starting this, I’ll assume that you have Rails installed, along with the WEBrick web server (this server is normally provided as part of your Rails installation). Alternatively, you may use some other server such as LightTPD or Mongrel, but the use of these servers is not described in this article. You will also need, at the very least, a text editor and a web browser.

Ruby Classes and Objects

Ruby is an object-oriented programming language; this chapter will show you what that reallymeans. Like all modern languages, Rubysupports object-oriented notions like classes, inheiritance, and polymorphism. But Ruby goes further than other languages you may have used. Some languages are strict and some are permissive; Ruby is one of the most permissive languages around.Strict languages enforce strong typing, usually at compile type: a variable defined asan arrayc an’t be used as another data type. If a method takes an arrayas an argument,you can’t pass in an array-like object unless that object happens to be a subclassof the array class or can be converted into an array.

Create A Controller

The Controller is where much of your Ruby code will live. It is the part of the application that sits between the View (what appears in the browser) and the Model (what happens to the data). As this is a ‘Hello world’ application, let’s create a Controller to say hello. In the spirit of originality, I’ll call this the SayHello controller. Once again, you can create this by running a script at the system prompt. You will need to open another command window in the directory from which you previously ran the server (e.g. C:\railsapps\helloworld). You can’t re-use your existing command window as the server is running in that one and you would need to close it down to get back to the prompt – and that would stop our Rails application from working!

Previous< 13 14 15 16 17 18 19 20 21 > Next
  Copyright 2000-2006 © SoloScript.com, All rights reserved.