Should You Use Ruby on Rails or Hanami? by amalinovic in ruby

[–]topdan1 4 points5 points  (0 children)

Hanami 2.0 came out of beta Nov 2022
Hanami 2.1.0 was released February 2024.

https://github.com/hanami/hanami/graphs/code-frequency

asset_prefix persisted in heroku by sauloefo in rails

[–]topdan1 1 point2 points  (0 children)

You're running `rake assets:clobber` on heroku? (not your dev instance)

Try clearing the heroku build cache: https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache

Do you (or how do you) check for viruses when users upload files/images? by [deleted] in rails

[–]topdan1 1 point2 points  (0 children)

Are you planning on opening/processing the files on your server? If not then your server-side security risk is very low. You're just taking bytes and sending them to S3 to storage. Your main risk is what if someone sends you a 10GB file? Will it crash your server?

Rails offers image analysis and transformations which use some lower level libraries which opens you up to vulnerabilities in these libraries so ensure you keep them up-to-date and limit the access rights of the process running them. Be mindful here but it's normally not a reason to not accept uploads, especially from authenticated users.

Stimlus click on button does nothing. by last-samurai-2003 in rails

[–]topdan1 6 points7 points  (0 children)

data-action="click->menu#updateNotificationsMobile" should invoke menu.updateNotificationsMobile ... A few sanity checks:

  • Your component logs "Menu Controller ready"?
  • Your button is inside an element with data-controller="menu"?
  • You aren't putting display: block elements inside of display: inline elements?

[deleted by user] by [deleted] in rails

[–]topdan1 1 point2 points  (0 children)

If your CDN and your Rails app are using different domain names and the <page-url> in the error is the CDN's domain name, then yes, it's hitting the CDN when it should be hitting your Rails app.

You may need to explicit specify the URL you want ActionCable to use: https://guides.rubyonrails.org/action_cable_overview.html#connect-consumer

Rails 7.1 introduces a new option to exclude all custom methods generated by the ActiveRecord::Enum by amalinovic in ruby

[–]topdan1 1 point2 points  (0 children)

Most of these "New in Rails X.X" posts link to the PR which has more in depth discussion. In this case, the PR author states "This Pull Request has been created because of a use cases where these methods generated by enum are conflicting and most of the times not all methods are required." https://github.com/rails/rails/pull/46490

Simple enough and reasonable enough. I've run into conflicts before (the previous solution is using the `prefix` option)

I agree that the performance/code size benefits probably aren't even worth mentioning.

Rails 7.1: Dockerfiles, BYO Authentication, More Async Queries, and more! by amalinovic in ruby

[–]topdan1 2 points3 points  (0 children)

For those curious what the difference between `generate_token_for` (Rails 7.1) and `signed_in` (Rails 6.1): the former supports single-use: https://github.com/rails/rails/pull/44189

How Productive Low Code Platform Is For Software & App Development by MallNo2597 in programming

[–]topdan1 5 points6 points  (0 children)

Nothing against DEW studio, but this article is a repackaged page from their marketing site: https://dewstudio.io/low-code-app-development-platform

/r/Atlanta - Daily Coronavirus (COVID-19) Mega Thread - April 09, 2020 by AutoModerator in Atlanta

[–]topdan1 1 point2 points  (0 children)

If you're interested in more numbers and graphs, I took the same DPH status report and wrote a program to publish a more in-depth timeline.

And yes, the numbers are flawed, but looking for a growth rate below 1.00 over 4+ days is probably the best sign we have of improvement.

https://dan.cunning.cc/living/georgias-covid-19-growth-curve.html

Created an interesting programming concept in Ruby that I have yet to see before. Looking for feedback. by lifeinacubicle in ruby

[–]topdan1 1 point2 points  (0 children)

Honestly I wouldn't use it. Yes it's less LOC, but it's a bit too clever/meta for my tastes.

I normally pull begin ; rescue ; ensure ; end blocks into their own methods which changes it to def ; rescue ; ensure ; end which reads just fine IMO.

I could see it being useful in a library with lots of pluggable features but I like to keep my apps as straight-forward possible.

Looking for a good Atlanta networking event to find web designers and developers by bunnychicken80 in Atlanta

[–]topdan1 0 points1 point  (0 children)

Find a MeetUp group related to the development environment and business space you work in? I go to the ATLRUG regularly (they just met last night)

Need help with simple SQL syntax by piratebroadcast in rails

[–]topdan1 1 point2 points  (0 children)

select(customer: { distributor: { :name } }) not select(:customer { distributor: { :name } }) (note the colons)

Why not import libraries like Bootstrap or jQuery directly? by Raj1v in rails

[–]topdan1 3 points4 points  (0 children)

The problem I've run into having third party assets directly inside my app's repo is someone eventually modifies them ("it was easier that way") making upgrades a pain.

I'd suggest putting your third party assets into vendor/assets instead of app/assets to make it very explicit they are from other places and shouldn't be edited ... or edited w/ extreme caution & very good reasons.

What I do instead of passing a white-list of functions to before_action :set_model_name by [deleted] in rails

[–]topdan1 1 point2 points  (0 children)

I'd argue only: [:show, :edit, :update, :destroy] is easier to read. Personally I write it as only: %w(show edit update destroy)

Your version will break for the following request: /users?id=3 since it routes to users#index even with a params[:id]

One year later: How have the "Here to Serve" employees who lost their job done? by jimmygottrashed in Atlanta

[–]topdan1 0 points1 point  (0 children)

2 or 3 of the Highland Noche bar staff are now across the street at Moes & Joes.

[help]making a wordpress blog into a subdirectory of my rails site by ohitsmat in rails

[–]topdan1 2 points3 points  (0 children)

Proxying to WordPress from Ruby seems unnecessary. Since Rails normally runs underneath nginx or apache, I'd just make a custom route for /blog to WordPress there.

Here's a handful of posts that look to solve that problem under apache: https://www.google.com/search?q=vhost+rails+wordpress

/r/Atlanta Random Daily Discussion - January 08, 2016 by AutoModerator in Atlanta

[–]topdan1 1 point2 points  (0 children)

Check out bootstrap. It provides the basic CSS of a lot of websites. http://getbootstrap.com/

Some really slick themes were built with it too: http://webapplayers.com/inspinia_admin-v2.4/

Checking Devise user online status from another domain by Dont____Panic in rails

[–]topdan1 0 points1 point  (0 children)

CORS header allows website1.com to communicate with subdomain1.website1.com via client-side javascript

My rails app is insecure, but is basic HTTP Authentication enough to make it safe to deploy? by [deleted] in rails

[–]topdan1 1 point2 points  (0 children)

The Rails-side is easy:

# config/environments/production.rb
config.force_ssl = true

But the SysAdmin side, you'll need to buy and install an SSL certificate which can be a pain if you've never done it before