Roda is a routing tree web framework toolkit, with the primary goals of simplicity, reliability, extensibility, and performance.
Questions tagged [roda]
23 questions
6
votes
1 answer
How to get the client's IP address in Roda?
I'm using Roda, and I need to get the client's IP address from the http request. In Sinatra, I think this would be:
request.ip
Is there an equivalent method in Roda?

cksk
- 63
- 1
- 3
3
votes
1 answer
How to ask if something is .present? in a view in Roda
I am converting a Rails app to Roda. Here's a section of a partial.
# _banner.erb
<% if banner.present? %>
...
<% end %>
This returns the error: NoMethodError: undefined method 'present?' for []:Array.
How can I get Roda to support something…

sscirrus
- 55,407
- 41
- 135
- 228
3
votes
1 answer
problem while trying to implement a drag and drop direct upload with shrine direct_upload for aws rails 5.2
Code:
image_upload.js
function uploadAttachment(attachment) {
var file = attachment.file;
var form = new FormData;
form.append("Content-Type", file.type);
form.append("forum_post_photo[image]", file);
var xhr = new XMLHttpRequest;
…

Corey Gibson
- 343
- 1
- 17
3
votes
1 answer
How to get single result as an array rather than a Model in Sequel ORM
I am working on a simple application using Roda Ruby gem and Sequel. I want Sequel to return a single result as a array rather than a Model object type. When there is more than one item, it returns an array but when there's only one, it returns a…

B A
- 1,089
- 2
- 14
- 24
2
votes
2 answers
Simple Roda app with routes in separate files
I'm trying to learn Roda and am having a bit of trouble moving into a style of separating out routes into their own files. I got the simple app from the Roda README running and am working on that as a base.
I am trying to use the multi_route plugin…

mwdowns
- 75
- 1
- 2
- 8
2
votes
1 answer
List All Routes in a Roda app
In Rails I view all the routes I have defined via:
rake routes
Is there a built in way to do this in a Roda app?
If not, is there a common pattern Roda developers use to quickly view all the routes (maybe a Rake task of some sorts?)

hetre85
- 39
- 8
1
vote
0 answers
Loading dependencies in Roda + Sequel API
Recently I've been experimenting with Roda + Sequel. I created simple API that has the following file structure:
├── CHANGELOG.md
├── Gemfile
├── Gemfile.lock
├── Procfile
├── README.md
├── Rakefile
├── app
│ ├── models
│ │ ├── category.rb
│ …

Mateusz Urbański
- 7,352
- 15
- 68
- 133
1
vote
2 answers
Testing user password update with RSpec
I have an API built with Roda + Sequel stack. Here is how my User model looks like:
# frozen_string_literal: true
# {User} is model responsible for storing {User} authentication informations like email and password.
#
# @!attribute id
# @return…

Mateusz Urbański
- 7,352
- 15
- 68
- 133
1
vote
1 answer
Creating MongoDB indexes via Mongoid in non-Rails environment
I am trying to build a Roda-based (non-Rails) API using MongoDB as my database. I installed Mongoid gem and configured the connection. Unfortunately, when I am trying to create defined indexes using rake db:mongoid:create_indexes, the task fails due…

Tomasz Jóźwik
- 43
- 3
1
vote
0 answers
Is it possible to use Rails authenticate_with_http_token with Roda app?
I made an API with Rails that authenticates using authenticate_with_http_token method. This is working great.
The API uses tus-ruby-server for resumable file uploads. Tus::Server is a Roda app. I can use hooks to add authentication. It is working…

Martin
- 11,216
- 23
- 83
- 140
1
vote
1 answer
How to divide nested routes in Roda
I write an application using Roda.
I have a nested router like this:
route 'chats' do |r|
env['warden'].authenticate!
r.is do
@current_user = env['warden'].user
r.get do
# code is here
end
…

user3517175
- 363
- 2
- 14
1
vote
1 answer
ORM JSON request handling for dataset insert
I am trying to view the JSON request which is sent from POSTMAN through a POST request to add a security group info to a table, and my request looks like one below
POST /securitygroup HTTP/1.1
Host: localhost:9292
Content-Type:…

Balaji Mohandas
- 65
- 9
1
vote
1 answer
How can I generate a link/route/path in Roda?
How can I generate a path or URL in a view in Roda?
Will I need to use a plugin? If not, how else? Or will I have to hard-code urls/paths?
In Rails I'd do this way:
<%= home_about_path %>

Bingi
- 59
- 6
1
vote
2 answers
Ruby Sequel SQLite3 app saves valid objects to database with NULL attributes
I'm having problems creating new objects on my application. Apparently the data gets lost somewhere between my Sequel::Model and the db table itself, resulting in entries with an id and all attributes in NULL.
This is my model:
class Wallet <…

ntonnelier
- 1,539
- 3
- 23
- 49
1
vote
2 answers
Rom-sql Rake Task
I'm trying to setup migrations using 'rom/sql/rake_task'.
Here is my sample, but sadly it isn't working as it's complaining about a missing sequel adaptor. Any assistance or direction would be appreciated?
require 'sqlite3'
require 'rom-sql'
require…

Dane Balia
- 5,271
- 5
- 32
- 57