Questions tagged [hanami]

Hanami is an open source web framework for Ruby developed by Luca Guidi.

Hanami is a web based framework for Ruby that puts the focus on simplicity, fewer DSL's, few conventions, more objects, zero monkey-patching of the core language and standard lib and separation of concerns for MVC layers.

It suggests patterns, rather than imposing patterns. It leaves all the freedom to developers to build their own architecture, choose the inheritance structure. It tries to simplify testability, and encourages single, well defined responsibilities between classes.

Hanami was formerly known as Lotus, the name was changed to avoid trademark issues.

90 questions
0
votes
1 answer

Hanami repository delete/update operations using joins

I'm having some trouble doing delete/update operations using joins on a repository. I have Libraries that belong to Users and have many Books, like so: class LibraryRepository < Hanami::Repository associations do belongs_to: user has_many…
Rodrigo Vasconcelos
  • 1,270
  • 2
  • 14
  • 26
0
votes
0 answers

Error with Hanami has_many associations (in 1.1.0.beta1)

I am using Hanami 1.1.0.beta1 (because I need associations). An event can have many actions: class EventRepository < Hanami::Repository associations do has_many :actions ... end class ActionRepository < Hanami::Repository associations…
E. Rubin
  • 1
  • 1
0
votes
1 answer

Using parameterized views with Hanami repositories

I prepared view in my PostgresDB called user_details. I created UserDetail entity and UserDetailRepository. Here you have shortened version of my view to visualize my problem: CREATE VIEW user_details AS SELECT id, user_name FROM users WHERE…
dewastator
  • 213
  • 4
  • 13
0
votes
1 answer

Using hanami ORM to do autocomplete

I am trying to implement autocomplete with hanami-model and I am trying to find in documentation or google how fetch records using LIKE function. I am trying to reflect following SQL query using hanami repositories: SELECT * FROM users WHERE name…
dewastator
  • 213
  • 4
  • 13
0
votes
0 answers

Connect ember with an api server via nginx

I have a nginx proxy server that connects the api server to my ember client. This is working without any problems. But when I hit the refresh button an any route except the root route the browser hits the proxy and it tries to serve the specified…
Shimu
  • 1,137
  • 11
  • 25
0
votes
2 answers

Accessing Hash Value in Test

I'm following a Hanami tutorial and I can't work out what's going wrong in this test: describe Web::Controllers::Books::Create do let(:action) { Web::Controllers::Books::Create.new } let(:params) { Hash[book: { title: 'Confident Ruby', author:…
thesunneversets
  • 2,560
  • 3
  • 28
  • 46
0
votes
2 answers

implement a booking lock for users in a scheduling app

I've built a scheduling web app where users can book a conference for a given date and time slot on that date. Now I need to implement a booking lock, which means that the admin can apply this lock and users can no longer book from that time on. My…
Sebastjan Hribar
  • 396
  • 3
  • 13
0
votes
1 answer

Implementing Form Objects in Hanami

In Uncle Bob's clean architecture, which Hanami is inspired by, Form Objects guard the boundary between Interactors and our delivery mechanism (typically an http endpoint). In the Hanami docs, bounary guarding is done using params blocks in Actions…
Jonah
  • 15,806
  • 22
  • 87
  • 161
0
votes
1 answer

method-call in REPL returns weirdly nothing

I am recently trying to implement a mixin, which accesses a configuration-object based on the namespace of the point of execution. The following snippet from my mixin extracts that namespace-part and caches it in an instance-variable of the…
Florian Neumann
  • 5,587
  • 1
  • 39
  • 48
0
votes
2 answers

LotusRb vs Ruby on Rails

What are the main differences between LotusRb and Ruby on Rails. At the first sight LotusRb looks very much similar to Rails. What are the pros and cons of Lotus compared to Rails?
0
votes
1 answer

How to override Content-Security-Policy for a specific action

I can obviously change the Content-Security-Policy in views/application.rb. I can also add a different Content-Security-Policy for development mode. How I can use a different Content-Security-Policy for a specific action/actions?
John La Rooy
  • 295,403
  • 53
  • 369
  • 502
0
votes
1 answer

Get error when loading assets in Lotusrb

I am trying out Lotusrb framework and I am having problems with assets. I followed the instructions for using in lotus from lotus-assets in github but I get the error Errno::ENOENT: No such file or directory @ realpath_rec. The error happens when I…
Lekeasong
  • 165
  • 1
  • 7
0
votes
1 answer

Lotus ruby issue with db create and gem.lock

Hello I have a problem when I do Lotus db create with the bookshelf's tutorial lotus db create enter code here WARN: Unresolved specs during Gem::Specification.reset: rack (>= 1.0, >= 1.0.0, ~> 1.5) WARN: Clearing out unresolved specs.…
0
votes
2 answers

Less-than queries in a Lotus Model Repository

Is it possible to perform the following query in a Lotus::Model Repository? def active query.where("publish_at >= #{Date.today}") end In Sequel, which Lotus::Model uses, you can do the above or you can pass it a block like so where{publish_at >=…
Jamie Wright
  • 1,160
  • 10
  • 23
-1
votes
1 answer

How to get the `hanami routes` command to include additional objects

The overview documentation for routes has examples of objects being used for route resolution such as get '/rack-app', to: RackApp.new, which work as documented with code like: options '/*', to: MyApp::CORSRequestHandler.new From the console and…
1 2 3 4 5
6