jodosha on unstable
Update rake to version 13.0.0 (… Rack 2.1 (#197) Ruby 2.7.0 (#198) and 4 more (compare)
depfu[bot] on update
Update dry-validation to versio… (compare)
jodosha on unstable
Update rake to version 13.0.0 (… Rack 2.1 (#305) Ruby 2.7 (#306) and 4 more (compare)
jodosha on develop
Update rake to version 13.0.0 (… Rack 2.1 (#305) Ruby 2.7 (#306) and 3 more (compare)
Can someone help with translating the default validation messages? Following the guides here I provide simple translation like this:
sl: errors: filled?: "mora biti izpolnjeno"
in the yaml file that is loaded by the I18N gem. The validations, however, don't pick the translation.
DomainValidatorhere, maybe that helps you in figuring out what's going on?
handle_exceptionsany exceptions that happen in the view do not appear either in the stdout or sent to HoneyBadger, but if the exceptions are raised in the controller are. Is this expected? and if so, what is the best practices for understanding view exceptions with
@kaikuchn Yes, I assume the spec and the fixture as in the links above are set up to be used in an interactor, right? The main difference being the validations define
messages :i18n also seen here. There is no specific path defined for messages. While there is one when the validations block is used within the
Paramsclass. You can see the same here in Hanami docs.
My use case is to have the 1. default messages translated after params are validated and then 2. process them again, prepending each one with the translation of the word
field to avoid dealing with inflections.
The second part is implemented, but the error messages still need to be translated. As for i18n, it's implemented across multiple apps and works with no problem (implemented as already mentioned above: https://www.bounga.org/ruby/2016/10/08/using-i18n-with-hanami/).
@kaikuchn I was overthinking it. The key issue lies with the
messages method, where it should be enough this:
messages :i18n. After trying a few things I went over the issues and I came across hanami/validations#129 and also the required workaround:
params do configure do config.messages = :i18n end end
With this, the validations pick up translated messages.
my team has just started using Hanami recently for a new project. we've been meaning to use it for a long time. have a few fanboys of Hanami who were waiting for this to happen for a long time, so we're really happy so far
quick question: anyone knows of any similar initiative to brakeman that would work similarly for hanami?
Hi.. I am new to Hanami and I am finding a way to write migration to set a column with a value. For example, I have created a new column(total) in savings table and I want to run a migration to calculate the total and fill into that column for each records in the database.
What usually you do and how do you it in Hanami?
friends, new to hanami here. Is there a good way that I can get Hanami::Router to route requests to different controller based on the MIME type but for the same path? ex:
get /foo (mime: text/html) =>
I was able to get it working by passing a proc to the routing target and having the decision happen there, but I wonder if there's a prettier way?
get "foo", to: -> (env) do if env[:request].html? HTML::Foo.new.call(env) else API::Foo.new.call(env) end end
/foo => /foo.jsonand then match on that. This could be done by a very simple rack middleware that you insert before the router middleware or by a reverse-proxy like nginx that sits in front of your app.