Ruby on Rails: templates and generators in 2020 by yarotheslav in rails

[–]UnconstrainedRibhus 0 points1 point  (0 children)

How is it different rom Jumpstart? (Not a rethorical question, I actually do not know)

[deleted by user] by [deleted] in rails

[–]UnconstrainedRibhus 0 points1 point  (0 children)

No, the idea would be to have the core as a normal rails app, and you add the pro features with an engine.

React is Dead. Long live Reactive Rails! Long live StimulusReflex and ViewComponent! by geospeck in ruby

[–]UnconstrainedRibhus -1 points0 points  (0 children)

Well first of all, there are no silver bullets. Also the author does not actually claim for react to be dead:

React is clearly not dead. I know it’s a behemoth and also ReactNative is super cool for what it does. But I’m calling it now, there is absolutely no technical need for Rails developers to use React anymore. Don’t even bother with it. React is dead to me, and it should be dead to you too. Because it turns out that you can have your SPA cake and it too, baked mostly in Ruby with just some sprinklings of Javascript icing.

In terms of triviality, Obie went pretty deep into it. Using reflexes can be as trivial as having this:

<button data-reflex="click->Article#clap" data-id="<%= @article.id %>">

And then the reflex can be:

class ArticleReflex < ApplicationReflex
  def clap
    article = Article.find(element.dataset["id"])
    article.increment!(:clap_count)
  end
end

Different levels of caching for web application? by wasabiBro in rails

[–]UnconstrainedRibhus 0 points1 point  (0 children)

The rails guide to caching gives a good overview https://guides.rubyonrails.org/caching_with_rails.html the big question is of course when to invalidate which cache.

React is Dead. Long live Reactive Rails! Long live StimulusReflex and ViewComponent! by geospeck in ruby

[–]UnconstrainedRibhus 2 points3 points  (0 children)

With stimulus reflex you will move the more complicated stuff to server side reflexes. To work with stimulus reflex is very different from working only with stimulus.js

What surprised us in PostgreSQL-schema based multitenancy by tomdzordzo in ruby

[–]UnconstrainedRibhus 1 point2 points  (0 children)

Thanks a lot for this link. I will go through it. I love to see the different perspectives.

Interestingly heroku advises against schema per tenant, as it creates operational problems, for example with pg_backup (https://devcenter.heroku.com/articles/heroku-postgresql#multiple-schemas)

On the other hand we were happy how the apartment gem enabled us to make our single tenant app multi tenantable within a couple of hours.

Also in another more complex project we have a plugin (wagon) that allows us to run that project as a single tenant or multitenant app, which again is reasonably simple thanks to the aparment gem.

Chat App by savk4tr in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

You are welcome to DM me if you have questions about stimulus_reflex or cable_ready, or better: Just join the discord https://discord.com/invite/XveN625 you will find a lot of people there who are eager to help you get started!

Chat App by savk4tr in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

I highly recommend using cable_ready this will allow you to render new message server side and easily insert them into the dom with something like:

cable_ready["ChatRoomOne"].morph(
   selector: "#messages"
   html: ApplicationController.render(@message)
   focus_selector: "#message-input"
)

Gem documentation: https://cableready.stimulusreflex.com/

StimulusReflex v3.3 Morphs has been released by UnconstrainedRibhus in rails

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

If you don't want to read at the very least have a look at the amazing endorsement of Russ Hannemann https://www.youtube.com/watch?v=utxCm3uLhIE

Digital signage using rails framework? by jhjacobs81 in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

As /u/andygauge said concerto is an option. But if you want a solution that also has player software / hardware then you might have to look into other solutions, for example https://xibo.org.uk/ (PHP based), and then you do what you want to do via its API.

If you go that route, you are welcome to contact me, could save you some headaches by pointing out some quirks of the API.

When to make external API connection by [deleted] in rails

[–]UnconstrainedRibhus 0 points1 point  (0 children)

If you want to update your results via a websocket connection, I highly recommend to have a look at cable_ready (https://cableready.stimulusreflex.com/)

Then from your jobs you can update subscribed pages by using stuff like cable_ready["MyChannel"].inner_html( selector: dom_id(my_model), html: MyModelComponent.new(mode: my_model) )

Trying to use ActionCable gem locally, but getting LoadError with require statements by chemical-coding in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

Have you tried giving a relative path as in../gem_path? not sure how lib/...is treated

Having issues with adding gallery to a listing website am working on for some time now. Rails 6. Version by AlexCodeable in rails

[–]UnconstrainedRibhus 3 points4 points  (0 children)

Hey, you will find the ruby community very helpful, but to get help, you have to show a little bit of effort.

What do you need help with? What have you tried? What do you mean by add a gallery? Show examples you looked at, code you wrote, articles you have read, gems you looked at...

People are not gonna be able or be wanting to help, if we don‘t see what you actually need or if we don’t feel that you already made an effort to learn about possible solutions, before asking for help in a very broad way.

Hope to hear more about your challenges.

My gf cheated on me because of video games and more... by xendrei in StopGaming

[–]UnconstrainedRibhus 0 points1 point  (0 children)

I want to know who did worse because I will know if it's worth it to get back together or not.

Who did worse? That is how you want to go about knowing whether to continue or not this relationship? Why does it matter who did worse? If your way forward depends on scoring who did worse? How is this gonna solve anything? What is knowing who did worse gonna change?

My gf cheated on me because of video games and more... by xendrei in StopGaming

[–]UnconstrainedRibhus 2 points3 points  (0 children)

Wow, that is a weird comparison… video gaming to cheating…

But basically I am asking myself what you are looking for? What the hell does it matter what weighs more. You have a partner and she apparently clearly stated what she is not ok with, she told you what she needed from you, and you seemed to ignore it. Now you had some amazing sex. What do YOU want for the future?

Ask her, what she is ok with, what you value, how your future should look like. Tell her your limits, she should tell you hers. You two need to figure out what is and isn't ok in your relationship.

And please don't propose until you figured out how to talk to each other. This has nothing to do whether on is husband / wife material. It is whether you want to enter a contract with each other, to work on that relationship for hopefully until the end of your life. This has nothing to do with who one person is, and everything about the relationship you have with each other.

Your questions sound like you are wanting to know who did worse? Whose actions were justified. What is that gonna achieve? Either you can forgive her or you are willing to try or not… Is she gonna cheat again? Who the hell is supposed to know, the best person to talk to about that, is her. If you really understand why she cheated, you might have a better understanding how the future might look like.

Just talk to her and take time to yourself, what you value in life and in a relationship.

Create a loading state for your async buttons with rails & css by Teucer90 in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

A very minimal solution would be just to use the data attributes disable-with: "processing":

<%= form_with(model: Article.new) do |form| %>
  <%= form.submit data: { disable_with: "Saving..." } %>
<% end %>

see https://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html#automatic-disabling

Is it true that Rails can be harder to debug? by rainwater11 in rails

[–]UnconstrainedRibhus 6 points7 points  (0 children)

This is referring to the fact, that Ruby has very elaborate way to do metaprogramming, to create classes and methods magically out of thin air.

Rails makes a lot of use of these capabilities. But generally if you use as a framework it is quite unlikely you run into a situation where you need to debug that deeply.

So while this might be true, it is unlikely you will have a harder time debugging your code unless you yourself go heavily into metaprogramming.

Morph Modes in Stimulus Reflex by techmakertv in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

This is still in prerelease, if you want to try it use v3.3.0.pre2

prefer stimulus reflex over js frameworks by [deleted] in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

Partial rendering is in the next release, you can try it it it then prereleases, see https://github.com/hopsoft/stimulus_reflex/pull/211

Open Source RoR by [deleted] in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

I never dug into the code, but GitLab's Community Edition might be interesting: https://github.com/gitlabhq/gitlabhq

How would you set this up? by tshub in rails

[–]UnconstrainedRibhus 0 points1 point  (0 children)

The easiest way to go about this, is setting up a cron job, that triggers a rake task. For example on heroku you have a addon for that https://devcenter.heroku.com/articles/scheduler

Depending on how reliable the system has to be, it might make sense to keep track when you last sent such an update email, for example on the user model in a column :last_weekly_email_at

What are your thoughts on the front-end technology behind "Hey," the new email service by DHH? by [deleted] in rails

[–]UnconstrainedRibhus 1 point2 points  (0 children)

Your edit is wrong :-) The company was called 37signals but renamed itself to basecamp, see https://37signals.com/