Questions tagged [chicagoboss]

Chicago Boss is a server framework inspired by Rails and written in Erlang.

Chicago Boss takes advantage of functional programming and under-the-hood compiler magic to provide clean, understandable controller logic, Django-style templates, and an ORM based on Erlang's parameterized modules. The best part is that the network I/O is 100% asynchronous so you can seamlessly integrate Comet endpoints into your app, and you never have to worry about a slow database query dragging down unrelated requests.

84 questions
2
votes
2 answers

Writing a query using orelse (OR) in chicagoboss

I looked for this query in Chicagoboss API, but could not find any solution to write a "OR" query. I have to write a query something like: select * from TableName where table.key1 = "XXXX1" OR table.key2 = "XXXX2" Here is my chicagoboss query, I…
user3401408
2
votes
0 answers

CRUD operations on list of items instead of a single one in ChicagoBoss

I'm a newbie to ChicagoBoss and Erlang in general, so please bear with me. I have a model of Options which represent a number of site configurations (think of the available options in WordPress, since it's modeled after it), to which I have to…
kenshin23
  • 129
  • 13
2
votes
1 answer

ChicagoBoss doesn't seem to be saving the right values into MongoDB

So I've worked my way through an evening with ChicagoBoss. I am now currently trying to wire up ChicagoBoss with MongoDB to build an app with it (and learn two new technologies I've been eyeing in the process). Unfortunately I seem to have hit a…
Abraham P
  • 15,029
  • 13
  • 58
  • 126
2
votes
2 answers

Show some html in loop for each N element

I'm just learning Erlang with Chicago Boss and would like to know how could I do something similar to this (in pseudocode): foreach (items as item) if (i % 10 == 0) endif ... if (i++ % 10 == 0) …
Antikido
  • 23
  • 2
1
vote
1 answer

make on ChicagoBoss failing with escript: exception error: undefined function rebar:main/1

I am trying to install ChicagoBoss based on the instructions here. Now, Make is failing with exception - =ERROR REPORT==== 14-Dec-2022::11:15:33.605319 === beam/beam_load.c(148): Error loading module rebar: please re-compile this module with an…
close2zero
  • 85
  • 8
1
vote
1 answer

Erlang Chicagoboss unable to get the correct JSON response

In my controller file I have a method that reads the incoming HTTP request, reads the user data from the Database, encodes the result in JSON (using jsx) and sends it in response. sensorusersdetails('GET', []) -> Headers =…
raich
  • 127
  • 1
  • 8
1
vote
1 answer

Controller action isn't invoked after before_ call in ChicagoBoss

I am trying to learn ChicagoBoss MVC web framework and this tutorial seemed a good start https://github.com/ChicagoBoss/ChicagoBoss/wiki/an-evening-with-chicago-boss It was all great and exciting untill the author introduced the before_ function…
m.awad
  • 187
  • 2
  • 13
1
vote
0 answers

Erlang chicago boss error while doing functional tests following the tutorial

I'm following the tutorial you can find here. I just reached the point in which I'm using the mock database to persist the greetings. I want to write a functional test about the list action, however whenever I try to run the test I get this…
1
vote
0 answers

Instagram Real Time API in erlang/ chicagoboss

I'm trying to implement instagram real time photo updates https://instagram.com/developer/realtime/ into my chicagoboss application When i request a location with the following curl -F 'client_id=CLIENT-ID' \ -F 'client_secret=CLIENT-SECRET'…
Capa
  • 65
  • 5
1
vote
0 answers

Basics of associations / relations in BossDB

Playing around with Chicago Boss, I have a model like this: -module(person, [Id, Name]). -compile(export_all). Lets say that I want to add the persons friends and foes. I came up with this. -module(person, [Id,…
EVK
  • 75
  • 7
1
vote
1 answer

Syntax error while compiling bson in chicaogboss

We upgraded chicagoboss which has the dependency of 'bson'. When we compile the chicagoboss using ./rebar update-deps compile. While compiling the chicagoboss it throws syntax error. But basically we pull it from 'HEAD'. I'm not sure if that is the…
trex
  • 3,848
  • 4
  • 31
  • 54
1
vote
0 answers

Use a chicagoboss built in filter in the code (outside of a template)

I was using filter add to create dynamic tab indexes {{tabindex_offset|add:1}} But seems to be it's throwing error for an undefined tabindex_offset. So wanted to add custom filter like this: add_by_custom(undefined, Count)…
trex
  • 3,848
  • 4
  • 31
  • 54
1
vote
0 answers

Concatenate string in the template

I have to prepare a url on the fly in the template by passing some variables to it. {% with init_sync_url='/baseurl/formid/'|add:form_id|add:'/context/' %} =={{init_sync_url}}=== {% myother_tag goto_url=init_sync_url %} {% endwith…
trex
  • 3,848
  • 4
  • 31
  • 54
1
vote
1 answer

filter over query results

I am using boss_db with erlang and chicagoboss. AFAIK, we should always try to use minimum number of database queries. Right now, I'm making two separate queries for a single result.Which I assume can be done in one query but don't know how.…
trex
  • 3,848
  • 4
  • 31
  • 54
1
vote
0 answers

Erlang ChicagoBoss access external files from URL

How to access external files from other servers using CB ? -module(example_index_controller, [Req, SessionID]). -compile([export_all]). index('GET', []) -> CSV = http:request(body, {"https://www.example.com/catalog.csv", []},…
busy
  • 367
  • 1
  • 4
  • 14