These are chat archives for synrc/n2o

7th
Oct 2016
AlexanderT
@AlexanderKai
Oct 07 2016 03:26
Доброе утро.
Как получить значение с radio элемента?
AlexanderT
@AlexanderKai
Oct 07 2016 06:24
name как я понимаю должен быть одинаковым? value - соответствующие значения. Атрибут checked нужно вручную проставлять при смене флажка?
Andy
@m-2k
Oct 07 2016 06:26
ты даже в html не можешь?
AlexanderT
@AlexanderKai
Oct 07 2016 06:26
в плане не могу?
AlexanderT
@AlexanderKai
Oct 07 2016 06:27
в html я вывел. согласно этой страничке.
через source в event не получится передать?
дайте рабочий пример, пожалуйста ))
единственное у меня нет action из тега form и button я не задавал. Они обязательны?
Andy
@m-2k
Oct 07 2016 06:38
у меня примеры слишком сложные :-)
если попроще то вот так например https://github.com/m-2k/erlach/blob/master/apps/erlach/src/html.erl#L432-L437
group можно заменить на
#fieldset{id=Id,class=merge_classes(radiogroup,Rc),legend=?HT(Title,S),body=RadioList },
а радио-элемент делать как
Label=#label{for=Rid,class=C,body=?HT(T,S)},
Radio2=Radio#radio{id=Rid,name=Id,value=Num,checked=V=:=Selected,body=Label},
Andy
@m-2k
Oct 07 2016 06:51
в общем вроде да, пихаешь список радио в fieldset, потом если надо будет значение узнать, берешь его из fieldset по его id, предварительно это id в source кнопки пихнув
AlexanderT
@AlexanderKai
Oct 07 2016 06:52
о! спасибо.
попробую вечером
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:10
Hi
i've got troubles serving static files with the default configuration
some files get served while others are not
I've enable the n2o_static module logging
both files shows the same info
quite a bit lost here !
Andy
@m-2k
Oct 07 2016 11:12
yep.. I also noticed some problems
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:12
side question : is n2o considered stable enough to be used in production ?
I'm coming from legacy nitrogen
just to be sure before basing all my devs on it
Andy
@m-2k
Oct 07 2016 11:13
yep, but use nginx for serve static
nginx more faster and safety
instead cowboy and others
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:14
yep but right now in trying it, i've not setup any nginx. I'm directy connected to cowboy
isn't cowboy fast/secure enough for production ?
Andy
@m-2k
Oct 07 2016 11:15
no
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:16
ok, but i find n2o_static quite practical for fast prototyping, so I still think it should behave consistenly :-)
Andy
@m-2k
Oct 07 2016 11:17
I did not experience significant difficulties with n2o_static
Try to isolate the problem
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:17
i'm currently trying, no success so far
Andy
@m-2k
Oct 07 2016 11:18
create detail issue on github and wait report
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:18
ok
thanks
Andy
@m-2k
Oct 07 2016 11:20
I'm doing now with other things, the problem with mad and n2o static are not critical and do not influence the production
patience or make a pull request
but in any case n2o is :3
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:29
ok, i've replaced n2o_static with cowboy_static and all files are served
that will do it for me by now i guess
i will submit an issue
Roman
@AstRonin
Oct 07 2016 11:55

for me in cowboy_router:compile() works fine

{"/favicon.ico",       cowboy_static,  {file, "/home/roman/dev/site/favicon.ico", mime()}},
{"/js/[...]",       cowboy_static,  {dir, "/home/roman/dev/site/js", mime()}},
{"/css/[...]",       cowboy_static,  {dir, "/home/roman/dev/site/css", mime()}},

mime() method from sample of n2o

Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:57
yep cowboy_static is ok, but not n2o_static
Matti Katila
@mudyc
Oct 07 2016 18:00
in http://synrc.com/apps/n2o/doc/web/endpoints.htm how does the cowboy_rest know which module to look for handlers?