ChicagoBoss遇到的几个问题

Boss 主要最成部分: BossDb, Models, Event, WebController, BossMq, Session, Templates
1、BossDb:实现对数据库的操作
2、Models:定义数据模型,提供相关操作方法
3、Event:定义对models事件
4、WebController: 定义Url和方法
5、BossMq:实现comet功能
6、Session:保存cookie和会话session
7、Templates:采用模板实现页面展现


1、文件上传用
       Req:post_files(). 对应 <form method="post" enctype="multipart/form-data">   可以同时一次上传多个文件默认指定目录是 scratch
2、 About boss_flash does not work
       First, ensure that your controller parametrized module has the SessionID:

-module(cbmock_test_controler, [Req, SessionID]).

Next (use SessionID, not Req): 

boss_flash:add(SessionID, notice, "Flash Titel", "Flash Message")

I can confirm that is working with the latests github code.
 我用的参数没有sessionId, API文档上没有明确指定,而是用Req 反而错了
3、英语语法问题,本不是问题的
      There is a people.erl and address.erl
     I set event with:
      1) boss_news:set_watch(4,"addresss",fun(Event, Record)-> error_logger:error_msg("Event=~p~nRecord=~p",[Event,Record]) end).
      2) boss_news:set_watch(4,"peoples",fun(Event, Record)-> error_logger:error_msg("Event=~p~nRecord=~p",[Event,Record]) end).
     
      Address = addres:new(id,"beijing","010").
      Address:save().
      There is nothing output.
      But, People:save() can output "=ERROR REPORT==== 1-Mar-2012::12:01:19 ===
Event=updated
回复
The correct plural forms are "addresses" and "people" 
我试了一下果然ok了
4、一个方法对应一个模板
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值