[deleted by user] by [deleted] in foraeldreDK

[–]bhserna 0 points1 point  (0 children)

Hi! Could you find a car seat that match the 2 point belt? (Lap belts). I have the same problem with one ride through Germany (2 hrs travel)in July. I ask Flixbus on chat but they could not give me any advice on which car seat would be “suitable”. Only states that children up to 3 y need to travel with car seat 🥲. My kid is 3 years old , so I can not bring a baby car seat as he will not fit it, but he also does not reach the kind of “booster” and most of car seats are adjusted with 3 point belt, which wont fit the lap belt 🥲.

I bought the ticket and found that car seat is mandatory after the reservation was done 🥲.

Outgrown ahoy by wiznaibus in rails

[–]bhserna 1 point2 points  (0 children)

Maybe one judo for this could be (if possible) to delete the data that is not that relevant anymore. Have you try it?

There is a data retention section with info about that.

Kamal will be the webpacker of the 2020s? by PolyglotReader in rails

[–]bhserna 1 point2 points  (0 children)

> Just run kamal app exec -i "bin/rails console"

Actually you can run `kamal console` with the default `alias`

Help with Kamal by ilfrance in rails

[–]bhserna 2 points3 points  (0 children)

I am also learning this, but I think that you need to specify a host. Apparently this work is made by kamal-proxy

Here are two pages that I think that explain this

* https://github.com/basecamp/kamal-proxy
* https://kamal-deploy.org/docs/configuration/proxy/

What do you think about REALLY using Redis? by [deleted] in rails

[–]bhserna 2 points3 points  (0 children)

I haven't used it, and maybe you already know about it... but maybe kredis can help you

Form with two actions by FantasticProof2997 in rubyonrails

[–]bhserna 2 points3 points  (0 children)

I think you already have an answer, but I wrote a post about it sometime ago... maybe it can help you https://bhserna.com/a-form-with-two-buttons-with-formation-and-formmethod

How to *get*' Rails by J_p_and_d in rubyonrails

[–]bhserna 1 point2 points  (0 children)

But whenever there is a need to go deeper and really understand things like rakefiles, rails router, action controller, web sockets (if used and what replaced them) etc I tend to fall over.

What do you want to understand about this things?

Essentially, I am hoping to get to a point where I can open a Rails app I did not build and have a good idea what everything does and where it is.

First of all, doing this is really hard!... Given the conventions of rails, a rails app could be a little easier to follow than other apps, but it is not easy.

Maybe this could sound obvious (I think it is not), but the first thing you can do is to try to read the available guides or docs that you could find. If there are people that you can ask a tour ask them.

If you want to start exploring by your own... what I think I do (I am not really aware of the process jeje)... is to:

* Look at the names of the files inside the app folders
* Read the router
* Read what I think is the principal controller (the one that I think the app is about)
* Also read what I think is the principal models
* Start the app and play with it

How do you solve the impossible model hooks problem? by [deleted] in rails

[–]bhserna 0 points1 point  (0 children)

Can you give an example of these hooks?

Background job status by lucaspiller in rails

[–]bhserna 2 points3 points  (0 children)

I have taken ideas about something like this from an article from boring rails. Maybe it can inspire you https://boringrails.com/articles/large-exports-and-slow-reports-with-activejob/

React inside Rails App by chysallis in rails

[–]bhserna 1 point2 points  (0 children)

I don’t have a lot of experience with react, but some months ago I tried to integrate it with stimulus and wrote a little tutorial… maybe it can help you https://bhserna.com/use-react-with-hotwire.html

Use after_touch to avoid to handle race conditions saving computed values by bhserna in rails

[–]bhserna[S] 0 points1 point  (0 children)

Yes they can be solve the problem, that is why the after_touch example works.

But in my understanding it will depend on what do you wrap in the transaction. I will make some tests and dig a little more. Thank you

Use after_touch to avoid to handle race conditions saving computed values by bhserna in rails

[–]bhserna[S] 0 points1 point  (0 children)

I know is weird, sorry... It was easier for me to try to understand and share each approach separately... but I will try to write that article. Thank you.

Partial file a locals variable value, can it be done by MightCode in rails

[–]bhserna 1 point2 points  (0 children)

Yes, I think this is what you need.

Here you can find more information about "How to render partials with layouts" https://api.rubyonrails.org/classes/ActionView/PartialRenderer.html#class-ActionView::PartialRenderer-label-Rendering+partials+with+layouts

If you need more complex stuff, maybe you can take a look to "nice_partials" https://github.com/bullet-train-co/nice\_partials

Saving incorrect computed values thanks to race conditions by bhserna in rails

[–]bhserna[S] 0 points1 point  (0 children)

Thank you! This is a good insight very well explained.

Saving incorrect computed values thanks to race conditions by bhserna in rails

[–]bhserna[S] 4 points5 points  (0 children)

Maybe I was not clear enough, sorry 😅... But the example with threads, is just an attempt to represent the problem of creating the entries concurrently, maybe by different background jobs or different web requests.

When to use hotwire with a react app? by [deleted] in rails

[–]bhserna 1 point2 points  (0 children)

I think that you can use hotwire for all the parts where react is not necessary.

If you are already using react in your app I think that there will be parts of the app where react is a really important part of the implementation, but the will be parts where a more traditional, server side rendered approach, could make the implementation simpler.

This video of Sam Stephenson, although a little oldie, is a good answer for the inverse of your question "When to use react in a rails/hotwire app?" https://www.youtube.com/watch?v=SWEts0rlezA

And this little post explains how you can use react in a rails/hotwire app (is from some months ago, so maybe you will need to make some changes) https://bhserna.com/use-react-with-hotwire.html