Forum https://discourse.hanamirb.org – Code of Conduct http://hanamirb.org/community/#code-of-conduct
timriley on v2.0.0.beta2
timriley on main
Prepare for v2.0.0.beta2 (#1200) (compare)
timriley on prepare-for-v2.0.0.beta2
timriley on v2.0.0.beta2
timriley on prepare-for-v2.0.0.beta2
timriley on main
Prepare for v2.0.0.beta2 (#226) (compare)
timriley on prepare-for-v2.0.0.beta2
Prepare for v2.0.0.beta2 (compare)
timriley on fix-location-of-rack-require
timriley on main
Move require for rack inside to… (compare)
Hi all. I am wondering if anyone has done/is doing application-level encryption à la Active Record Encryption https://guides.rubyonrails.org/active_record_encryption.html
I am looking to add most of the feature set of AR Encryption to our application.
Hi!
I'm having Content Security Policy problems with the Hanami 2 template project. Anyone here that could give a hint on what's wrong? :)
I'm trying to getting started with Hanami. We're hopefully going to use it in a new client project soon so we thought we should have a go and see if we can get it up and running.
I'm using a quite recent version of the Hanami 2 template https://github.com/hanami/hanami-2-application-template. I have a slightly different tool set than the one suggested in the readme. So I'm starting the project with the following:
./bin/install hello_hanami
yarn
yarn run start
# in another shell
bundle exec guard --no-notify --no-interactions
The asset server is up and running at localhost:8080. The application server is also up at port 3000 and displays correct content, but it doesn't load any assets. I get errors regarding the Content Security Policy:
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:8080/assets/main/public.css (“default-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:8080/assets/main/public.js (“default-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:3000/favicon.ico (“default-src”).
I'm having some issues trying to utilize a params
block in an Action within hanami-2-application-template
. If I include the block, I receive an error: NoMethodError: undefined method 'params' for Main::Actions::Characters::New:Class
... digging into the code a bit, it appears that Hanami::Action:Validatable
, which includes the params(klass = nil, &blk)
definition, is only included in Hanami::Action::StandaloneAction
(which itself is included in Haname::Action
) if Validatable
is already defined: https://github.com/hanami/controller/blob/v2.0.0.alpha6/lib/hanami/action/standalone_action.rb#L55
...it seems to me I just need to add the correct gem to my Gemfile, or require the right library file (hanami/action/validatable
?) in the right source file, or something simple like that.
Any help?
I have a question about the Hanami.application
global. After digging through the code and testing it seems like this way of keeping a global reference to the app means that you can have only one Hanami instance running at once? So if I wanted to run two Hanami apps mounted at different paths in Sinatra, could I?
I'm not asking because I have that particular use case, but I am trying to solve some of the same problems that Hanami have solved and this is the final thing I'm stuck on. It might not be a problem for Hanami - normally you would just run a single instance anyway. But I'm building a REST API abstraction library and this global reference (if I understand it correctly) means that end users would not be able to have two API libraries based on my abstraction loaded at the same time - they would both try to use the global and get into a conflict, the same way you would if you tried to load two Hanami apps at once now.
Or am I missing something? :slight_smile:
new
command like I did with the rest of the options: hanami new pistachio --test=rspec --database=postgres --template=erb
UpdateUser.new.call(user)
. With this approach you can also unit-test the domain without mocking the db.
rich domain model means that the models contain the logic
Not in a functional way, you have your data and the module logic is the "owner" of this data.
That is how the rich domain is represented in functional.
Hanami allows us to design our code, takes all the advantages you can.
That's a big step comparatively of Rails that forces us in a MVC + RailswayTM
Failed to load resource: the server responded with a status of 404 (Not Found)
for a lot of assets. However, looking in the public\assets
folder the different app folders have those assets that are reported missing.
@/all Hanami v2.0.0 first beta!
hanami-api
, dry-system
and rom-rb
. I'm very happy with it. I read that hanami-api
may be dropped. It would be a shame for me if hanami-api
were to be dropped. What should I do? I don't necessarily want to migrate these projects to Hanami 2, but they should evolve. What would you advise me?Hi, we're still having issues with assets. In my dev environment everything works fine. When I deploy (still on my dev laptop) the app with Docker and using Hanami for serving static assets I get this in the console:
Failed to load resource: the server responded with a status of 404 (Not Found)
for a lot of assets. However, looking in thepublic\assets
folder the different app folders have those assets that are reported missing.
I haven't gotten any further with this. For example, one of the assets not found when running in Docker is this one: http://localhost:8091/assets/sentinel/w3-1ac375ab06574a481efcf0b7fed82b4c.css
. However, when I inspect the folder content I find it: /usr/src/app/public/assets/sentinel/w3-1ac375ab06574a481efcf0b7fed82b4c.css
. What am I missing?
hanami assets precompile
command so everything is setup as described here.