Posted by Captain Zhan
Sun, 18 Mar 2007 17:05:00 GMT
http://www.sergiopereira.com/articles/prototype.js.html
Chapter 10. Prototype Reference
10.1. Ajax Support
Ajax.Request, Ajax.Updater, and Ajax.PeriodicalUpdaterall of which inherit from Ajax.Base. After that is the Ajax.Responders object, which handles global ev
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Sat, 17 Mar 2007 11:47:00 GMT
with<Programming Ruby>
Chapter 4
Containers, Blocks, and Iterators
Containers
Arrays
a = [ 3.14159, "pie", 99 ]
a.class Array
&nb
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Thu, 15 Mar 2007 13:28:00 GMT
with <ajax on rails>
make fake form with the combination of link_to_remote and :submit option
3.4 Ajax Forms
form_for
remote_form_for
3.5
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Thu, 15 Mar 2007 13:17:00 GMT
with <Ajax on Rails>
S2.3. Bringing Rails into the Picture
complex
url_for example:
url_for :only_path => false, :protocol => 'gopher:// ',
:host => 'example.com', :controller =&g
Read more...
Posted in 站长文档, Ruby on Rails | no comments
Posted by Captain Zhan
Thu, 15 Mar 2007 13:14:00 GMT
<%= render :partial => "person" %>
the partial is named "person," the main template will look for an instance variable @person, and pass it to the partial as a local variable, person.
if the instance variable doesn't match the name of the partial, you'd explicitly pass it, like this:
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Thu, 15 Mar 2007 13:04:00 GMT
with <Ajax on Rails>
Chapter 2 .Getting Our Feet Wet
S2.1. The Old-Fashioned Way
<p><a href="#"
onclick="
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Mon, 05 Mar 2007 16:03:00 GMT
with <Programming Ruby 2nd>
Chapter 3
Classes, Objects, and Variables
Class
class Song
def initialize(name, artist, duration)
@name = name
@artist = artist
&
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Tue, 19 Dec 2006 17:10:00 GMT
def select_state_for_user
[["","Select State..."], ["AL","Alabama"],
["AK","Alaska"], ["AZ","Arizona"], ["AR","Arkansas"],
["CA","California"], ["CO","Colorado"], ["CT","Connecticut"],
["DE","Delaware"], ["DC","District of Columbia"],
["FL","Florida"],
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Thu, 30 Nov 2006 14:05:00 GMT
三种方式 Page Caching, Action Caching和 Fragment Caching
缓存默认只在production 环境下启动
Page Caching
caches_page :public_content
以URL为准
expire_page :action =>"public_content"
Read more...
Posted in Ruby on Rails | no comments
Posted by Captain Zhan
Thu, 23 Nov 2006 13:34:00 GMT
自动增加预载model方法:
class StoreController < ApplicationController
model :cart, :line_item
observer :stock_control_observer
# ...
如果没有找到相应的action, method_missing()将被调用
如果没有任何action, Rails会直接找template显示.
Read more...
Posted in Ruby on Rails | 2 comments