generate a html select from tag_module

26 views
Skip to first unread message

till haxor

unread,
Feb 28, 2014, 12:54:09 PM2/28/14
to chica...@googlegroups.com
i need generate a html select from tag_module and i dont know how to this....

   relatedSelect(Variables, Options) ->
       error_logger
:error_report( ["Variables:", Variables, "Options:", Options] ),
       
string:join(lists:map(fun(Module) -> io_lib:format("<option value='~p'>~p</option>", [Module,Module]) end, boss_db:find    (list_to_atom(binary_to_list(proplists:get_value(model, Variables))),[])), "").

where model is pased from template {% relatedSelect model="books" %}

can any help me?

till haxor

unread,
Feb 28, 2014, 3:37:38 PM2/28/14
to chica...@googlegroups.com
sorry, is solved.

string:join(lists:map(fun(Module) -> io_lib:format("<option value='~s'>~s</option>", [Module:id(),Module:name()]) end,     boss_db:find(list_to_atom(binary_to_list(proplists:get_value(model, Variables))),[])), "").
Reply all
Reply to author
Forward
0 new messages