$rails _1.2.3_ myapp
This will create myapp application which will use rails 1.2.3
Learning Sharing ROR...
$rails _1.2.3_ myapp
can't activate rubyforge (= 1.0.3, runtime), already activated rubyforge-1.0.4
sudo gem uninstall rubyforge --debug
ERROR: While executing gem ... (Gem::InstallError)
Unknown gem rubyforge >= 0
gem list -d
rubyforge (1.0.3)
Authors: Ryan Davis, Eric Hodel, Ara T Howard
Rubyforge: http://rubyforge.org/projects/codeforpeople
Homepage: http://codeforpeople.rubyforge.org/rubyforge/
Installed at: /home/deepti/.gem/ruby/1.8
A script which automates a limited set of rubyforge operations
sudo gem uninstall --install-dir /home//.gem/ruby/1.8 rubyforge -v 1.0.4
sudo gedit /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = USB Modem
ISDN = 0
Phone = #777
New PPPD = yes
Modem = /dev/ttyUSB0
Username = <your ten digit reliance netconnect number>
Password = <your ten digit reliance netconnect number>
Aug 16 19:35:57 abc-laptop kernel: [ 111.532151] usb 4-1: new full speed USB device using uhci_hcd and address 2
Aug 16 19:35:57 abc-laptop kernel: [ 111.744188] usb 4-1: configuration #1 chosen from 1 choice
Aug 16 19:35:57 abc-laptop kernel: [ 111.747614] usbserial_generic 4-1:1.0: generic converter detected
Aug 16 19:35:57 abc-laptop kernel: [ 111.748339] usb 4-1: generic converter now attached to ttyUSB0
Aug 16 19:35:57 abc-laptop kernel: [ 111.909454] usbcore: registered new interface driver libusual
lsusbwhose output will be like:
us 007 Device 002: ID 04f2:b008 Chicony Electronics Co., Ltd
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 12d1:142b Huawei Technologies Co., Ltd.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
sudo modprobe usbserial vendor=0x12d1 product=0x142b
ls -la /dev/ttyU*
crw-rw---- 1 root uucp 188, 0 2009-08-16 19:36 /dev/ttyUSB0
crw-r--r-- 1 root root 188, 1 2009-08-16 19:34 /dev/ttyUSB1
sudo mknod /dev/ttyUSB0 c 188 0
sudo mknod /dev/ttyUSB1 c 188 1
sudo wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Aug 20 22:06:00 2009
--> Pid of pppd: 7268
--> Using interface ppp0
--> pppd: [10]�[17]
--> pppd: [10]�[17]
| Donts | Dos | Why? |
<p> <%= form.label :title %> <%= form.text_field :title %> </p> | <div> <%= form.label :title %> <%= form.text_field :title %> </div> | <p> <div class="fieldWithErrors"> <label for="deal_title">Title<label> </div> <div class="fieldWithErrors"> <input id="deal_title" name="deal[title]" size="30" type="text" value="" /> </div> </p> got the problem? There are divs inside the paragraph tags, which is invalid markup |
<div> <%= form.label :location %> <%= form.select :location, Location::ALL %> </div> | <div> <%= form.label :location %> <%= form.select :location, Location::ALL, :include_blank => true %> </div> | Required Atribute If the option is required, prefer that the user gets a validation message saying they need a location instead of accidentally assigning location to Boston when it should be New York. Optional Attribute A blank default has no downside for an optional attribute |
Styling elements globally input { float: left; clear: both; } | form#new_user #first_name.text_field input { float: left; clear: both; } | Writing style to remain specific to page elements will save you from having to troubleshoot many strange layout bugs, and also saves you from having to reset these styles for any subsequent elements. |
Source | ||
config.action_mailer.raise_delivery_errors = true
ActionMailer::Base.delivery_method = :smtp#FOR UNIT/FUNCTIONAL TESTING THIS'LL BE :test
ActionMailer::Base.server_settings = {
:address => <replace with your SMTP server>,
:port => <your SMTP server's port>,
:domain => <your domain>,
:authentication => :login ,
:user_name => <set if your SMTP server requires authentication>,
:password => <set if your SMTP server requires authentication>
}
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"
ruby script/generate mailer <MyMailSender> <send_mail_method>
class MyMailSender < ActionMailer::Base
def send_mail_method(sent_at = Time.now)
@subject = 'MyMailSender#sendMail'
@body = {}
@recipients = 'xyz@xyz.com'
@bcc = ''
@from = 'abc@abc.com'
@sent_on = sent_at
@headers = {}
end
attachment :content_type => 'application/vnd.ms-excel',
:body =>
File.open("#{RAILS_ROOT}/public/test_sheet.xls","rb") {|f| f.read},
:filename => 'test.xls'
views/my_mail_sender/send_mail_method.rhtml
MyMailSender::deliver_send_mail_method
thing to remember is to prefix ur method with deliver_ whenever u call ur method.