12.31
Ruby on Rails: RESTFUL Rails PDF
By Satish Natarajan
Restful Rails PDF (Local Copy)
This is a must read for all ruby programmers who want to to RESTFUL rails
Findings, Tips & Tricks
Restful Rails PDF (Local Copy)
This is a must read for all ruby programmers who want to to RESTFUL rails
Step 1:
Step 2:
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]
...
endStep 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
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}”
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