2008
12.31

Ruby on Rails: RESTFUL Rails PDF

By Satish Natarajan

Original Link

Restful Rails PDF (Local Copy)

This is a must read for all ruby programmers who want to to RESTFUL rails

2008
12.31

Ruby on Rails: MySQL Enum support

By Satish Natarajan

Original Post

Step 1:

  • Install the plugin “script/plugin install enum-column”

Step 2:

  • Define the table schema. for example
    create_table :enumerations, :force => true do |t|
    t.column :severity, :enum, :limit => [:low, :medium, :high, :critical],
    :default => :medium
    t.column :color, :enum, :limit => [:red, :blue, :green, :yellow]
    ...
    end

Step 3:

In the model add validation
validates_columns :severity, :color

Step 4:

In the controller @e = Enumeration.new

Step 5:

In the views <%= input 'e', 'severity' >
This will create a select box with all the options

2008
12.31

Ruby on Rails: Various Render Call Possibilities

By Satish Natarajan

Render Call Possibilities

2008
12.31

Ruby on Rails: FormHelper Documentation

By Satish Natarajan

Form Helper Documentation

2008
12.31

Ruby on Rails: FormTagHelper Documentation

By Satish Natarajan

Form Tag Helper Documentation

2008
12.31

Ruby on Rails: Soap4r: WSSE Authentication

By Satish Natarajan

This is a good link to understand wsse header

2008
12.31

Ruby on Rails: SOAP4r: Simple example

By Satish Natarajan

require 'rubygems'

gem ’soap4r’
#Require The Library
require ’soap/wsdlDriver’

#Connections
wsdl_url = ‘http://xurrency.com/api.wsdl’
proxy = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver

#Call API Method and Get Exchange Rate
rate = proxy.getValue(1,’usd’,'eur’)
puts “Rate: #{rate}”

2008
12.31

svn status | grep ?

This will show you the list of files with ? at the begining of the line saying that it does not know the status of the file – which is a hint to add the file into svn using the

svn add <filename>

It is better to add files one by one in general

2008
12.31

Ruby on Rails: Installing restful_authentication plugin

By Satish Natarajan

  • Create the Project
  • cd PROJECT_DIR
  • cd vendor/plugins
  • git clone git://github.com/technoweenie/restful-authentication.git restful_authentication
  • cd PROJECT_DIR
  • For normal install run “./script/generate authenticated user sessions”
  • Now you can edit the users_table if needed and then run rake db_migrate
  • Create the Admin user
  • For detailed documentation please refer to: Restful Authentication Documentation
2008
12.31

Ruby on Rails: Select tag documentation

By Satish Natarajan

Excellent document to understand various select options