Hi TX, The deep_post_param function is to get many checkboxes of a kind into your controller. Give it a shot. :)
Sent from the trenches > On Sep 27, 2016, at 19:46, TX <2316134...@qq.com> wrote: > > Hi Kai, > > I am afraid this is not what I need. > > Thank you anyway. > > ------------------ 原始邮件 ------------------ > 发件人: "kotedo";<kot...@gmail.com>; > 发送时间: 2016年9月28日(星期三) 凌晨3:48 > 收件人: "chicagoboss"<chicagoboss@googlegroups.com>; > 主题: Re: [chicagoboss] some questions > > Hi TX, > > I found this on the API documentation; > > > deep_post_param( [ Path::string() ] ) -> DeepParam | undefined > Get the value of a given "deep" POST parameter. This function parses > parameters that have numerical or labeled indices, such as "widget[4][name]", > and returns either a value or a set of nested lists (for numerical indices) > and proplists (for string indices). > > Location of the documentation: > > http://chicagoboss.org/doc/api-controller.html > > basically at the end of the API docs. > > —Kai > > >> On Sep 26, 2016, at 22:22, TX <2316134...@qq.com> wrote: >> >> 1. Fuzzy search >> I saw in Chicagoboss's API that for db conditions >> >> {key, 'contains', Token} >> The "key" attribute contains Token. >> >> >> >> I created some products, with item no. being P01, P0101, SP01, then I >> searched by >> >> Products = boss_db:find(product, [{itemno, 'contains', >> string:to_upper(Req:post_param("itemno"))}]) >> >> Then I input P01, only P01 returned, P0101, SP01 didn't return. >> >> >> >> I then tried >> >> Products = boss_db:find(product, [{itemno, 'contains', >> [string:to_upper(Req:post_param("itemno"))}]]) >> >> Nothing returned. >> >> >> >> Then >> >> Products = boss_db:find(product, [{itemno, 'contains_all', >> [string:to_upper(Req:post_param("itemno"))]}) >> >> Only P01 returned >> >> >> >> Does it mean that boss_db:find can't do fuzzy search or my expression is not >> correct? If my expression is wrong, can anyone give me a hint what the >> correct expression should be? >> >> 2. Multiple params >> >> Suppose I have person and person has multiple interests, if there is only >> one interest posted to controller, I can use something like: >> >> CheckedInterest = Req:post_param("interest"), >> >> Interest = interest:new(id, CheckedInterest, PersonId) >> >> If I make a view page, use checkboxes to ask the user to check multiple >> interests(swimming, basketball, football...). When posted, many interests >> will come to the controller, how to save to the interest database? >> >> >> >> Not too many Chicagoboss examples can be found on Internet, appreciate your >> help. >> >> Thanks. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "ChicagoBoss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to chicagoboss+unsubscr...@googlegroups.com. >> Visit this group at https://groups.google.com/group/chicagoboss. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/chicagoboss/tencent_7046602443BE34D7355F6027%40qq.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "ChicagoBoss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to chicagoboss+unsubscr...@googlegroups.com. > Visit this group at https://groups.google.com/group/chicagoboss. > To view this discussion on the web visit > https://groups.google.com/d/msgid/chicagoboss/CD505F22-7938-4FBF-922D-C2D886B8A8FA%40gmail.com. > For more options, visit https://groups.google.com/d/optout. > -- > You received this message because you are subscribed to the Google Groups > "ChicagoBoss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to chicagoboss+unsubscr...@googlegroups.com. > Visit this group at https://groups.google.com/group/chicagoboss. > To view this discussion on the web visit > https://groups.google.com/d/msgid/chicagoboss/tencent_7A0F71B84A8031D67246A4D8%40qq.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "ChicagoBoss" group. To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/chicagoboss. To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/18AAE8BC-AF0A-424C-84AA-B22050024083%40gmail.com. For more options, visit https://groups.google.com/d/optout.