Saturday, August 16, 2008

Tips That'll Save You Time...

flash
Are you flash messages NOT showing up? Learn flash[:notice] and flash.now[:notice].

need to pass messages from controller to view from ajax calls
Learn page[:div_id].replace_html... a life saver

need to return more that 1 object from a method call?
Don't forget(I did), ruby can do this easily: 

def index
  @object1, @object2 = method(arg1, arg2)
end

...

def method(arg1, arg2)
  ..
  return object1, object2
end

No comments: