newland icon indicating copy to clipboard operation
newland copied to clipboard

完成flash机制

Open RubyLouvre opened this issue 13 years ago • 0 comments

flash是基于session的消息传送机制,我们可以把消息放到flash中并在下一个action访问到它们。 用法

flow.flash('info', 'email sent');
flow.flash('error', 'email delivery failed');
flow.flash('info', 'email re-sent');
// => 2

flow.flash('info');
// => ['email sent', 'email re-sent']

flow.flash('info');
// => []

flow.flash();
      // => { error: ['email delivery failed'], info: [] }

详见文档

RubyLouvre avatar Aug 20 '12 15:08 RubyLouvre