Ruby on Rails
This is a simple walkthrough for creating a Rails 3 application that supports token based authentication.
This is written for Rails 3 but should work just fine for Rails 2.x
You can find the source code of the demo app on github:
http://github.com/wnoronha/device-auth-demo
What is Jquery
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. -- From the Jquery Website.
Jquery is one of the many Javascript frameworks out there. Its competition includes YUI, Prototype, Moo etc.
Jquery UI
In additions to the framework; Jquery also has a powerful UI framework. Jquery and Moo have the most complete and easy to use UI framework now. It has widgets such as sliders, tabs, accordions, calendars, dialog and modal windows. It also has a very nice button framework.
You can find more information on their website http://ui.jquery.com.
Using thinking sphinx to search objects that are tagged using the acts_as_taggable_on plugin.
class Photo < ActiveRecord::Base ... acts_as_taggable_on :keywords define_index do indexes :caption indexes keywords.name, :as => :keywords end ... end
Now lets assign some tags to our Photo
>> photo = Photo.create :user_id => 1, :caption => 'BMW M7', :keyword_list => 'BMW, Car' >> photo.keywords => [#<Tag id: 1, name: "BMW">, #<Tag id: 3, name: "Car">]
Lets run the indexer

A quick hack to get a location's geo coding
require 'xml-simple' require 'net/http' # Enter the location to get the lat and long # def yahoo_geo(location) host = "api.local.yahoo.com" q = "http://api.local.yahoo.com/MapsService/V1/geocode" q << "?appid=wnorrix&location=#{URI.encode(location)}" xml = XmlSimple.xml_in(Net::HTTP.get(host, q), {"ForceArray" => false}) return xml["Result"] end
class Smokers < ActiveRecord:: Base belongs_to :heart_failure_statistics has_many :cigarettes attr_accessor :mins_since_last_puff before_validation :check_cigarettes def smoke? if mins_since_last_puff >= 60 write_warren("Smoke?") end end end
This is fucking sweet!
Finally after a long wait its finally here! There have been soo many changes since the early 0.5 days. I still remember the good ol' days where you had to do so many things manually. Thanks to the rapid development of the framework, most of this is taken care of now. I remember times where I had to spend time on apache to get things right and now every thing seems to work out of the box.
The community has grown from 10 to over 400 users (on IRC we lost a good few though). Hope to see Rails establish it self as the next industrial standard.
Some of you have already integrated my patch, some of you have already figured out how to use it without any help ( that was the initial plan after all ). As for those who don't, here goes.
I did promise earlier that the support will be modular just like our views, but since the system loads all the languages into memory before serving request, I decided to drop it for now.
Step 1. Locale directory
All the language files are supposed to be stored here.
# mkdir app/locale/Step 2. Create the lyml file
Not everyone speaks the same language, Google and Yahoo have lead the way to multilingual web applications. Rails promotes Web 2.0, and I think accessing your favorite application in your own language is a must for Web 2.0. I spent some time yesterday trying out the different ways of making my application support multiple languages, most of them were too complex for a Rails newbie to install and use. Rails has always been all about “out of the box” features, so I decided to sit and code up support for multilingual Rails.
These are some of the reports and benchmarks:
Run 1:









