These are chat archives for synrc/n2o

7th
Oct 2016
AlexanderT
@AlexanderKai
Oct 07 2016 03:26 UTC
Доброе утро.
Как получить значение с radio элемента?
AlexanderT
@AlexanderKai
Oct 07 2016 06:24 UTC
name как я понимаю должен быть одинаковым? value - соответствующие значения. Атрибут checked нужно вручную проставлять при смене флажка?
ты даже в html не можешь?
AlexanderT
@AlexanderKai
Oct 07 2016 06:26 UTC
в плане не могу?
AlexanderT
@AlexanderKai
Oct 07 2016 06:27 UTC
в html я вывел. согласно этой страничке.
через source в event не получится передать?
дайте рабочий пример, пожалуйста ))
единственное у меня нет action из тега form и button я не задавал. Они обязательны?
у меня примеры слишком сложные :-)
если попроще то вот так например 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},
в общем вроде да, пихаешь список радио в fieldset, потом если надо будет значение узнать, берешь его из fieldset по его id, предварительно это id в source кнопки пихнув
AlexanderT
@AlexanderKai
Oct 07 2016 06:52 UTC
о! спасибо.
попробую вечером
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:10 UTC
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 !
yep.. I also noticed some problems
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:12 UTC
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
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 UTC
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 ?
no
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:16 UTC
ok, but i find n2o_static quite practical for fast prototyping, so I still think it should behave consistenly :-)
I did not experience significant difficulties with n2o_static
Try to isolate the problem
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:17 UTC
i'm currently trying, no success so far
create detail issue on github and wait report
Sébastien Saint-Sevin
@seb3s
Oct 07 2016 11:18 UTC
ok
thanks
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 UTC
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 UTC

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 UTC
yep cowboy_static is ok, but not n2o_static
Matti Katila
@mudyc
Oct 07 2016 18:00 UTC
in http://synrc.com/apps/n2o/doc/web/endpoints.htm how does the cowboy_rest know which module to look for handlers?