robert

Joined

2,180 Experience
12 Lessons Completed
1 Question Solved

Activity

Posted in Developer wanted

There are many, share more details and you're going to find the right one.

Posted in Organizing Rails Model Files Discussion

+1

Posted in Rails upgrade companies

Difficult choice indeed. Ready to discuss this in public? What parts do you consider in the decision?

Posted in Is Ruby on Rails still relevant in 2023 ?

it depends...

Posted in How to upgrade to Rails 7.1 Discussion

Liked the quick tips. Curious to see the next.

Also documented some general concepts and references on blog beginning this year: https://roberthopman.github.io/how-to-upgrade-a-ruby-on-rails-application/

This seemed to break, updated to:

.then(html => { target = Turbo.renderStreamMessage(html) }

Posted in Responsive Navigation with Turbo Discussion

For Bootstrap, which might be outdated..:

<%= select_tag nil, options_for_select(items, request.path), class: "d-md-none", onchange: "Turbo.visit(this.selectedOptions[0].value)" %>

<div class="d-none d-md-block">
  <ul class="nav">
    <% items.each do |text, path| %>
      <li class="nav-item"><%= link_to text, path, class: "nav-link" %></li>
    <% end %>
  </ul>
</div>

perhaps

.reverse

Posted in Can anyone suggest me best Ruby on Rails 5 book?

Seems to be more of these link spam posts lately...

Perhaps constructive for future readers, here's a Trello example with Turbo, Stimulus and Sortable, to work with multiple nested resources (:compitems/:lists): https://github.com/john-hamnavoe/rails-trello-clone

Posted in Sortable Drag and Drop Discussion

This worked for me: https://stackoverflow.com/a/58580434/6430382

Start with removing jquery-ui:

yarn remove jquery-ui

Posted in cloudflare vs cloudfront vs ?

Hey Chris,

I've many images on S3 with avg size of 30KB per img that take about 1-2 seconds to display. I'm looking at cloudfront & cloudflare to speed this up. Later perhaps imgix, but I see it as too costly now.

Which one is a good choice? What should I look at besides pricing for my decision?

Posted in SQL for search

Hi Chris,

I had a question, solved it, now I'm looking for your feedback. For readability I use `a` in the example below:

a = params[:query]
Item.where("name ILIKE ? OR tagline ILIKE ? OR details ILIKE ?", "%#{a}%", "%#{a}%", "%#{a}%")

Do you have a similar query on gorails search for episode titles and forum thread titles?

Your pseudo code works out of the box :)

First tried it with counter cache, that works. But your method seems more elegant. And it also works.

Hey Chris,

I have an item model which gets submitted. With

has_many :comments, as: :commentable, dependent: :destroy

then in the comment model I have

belongs_to :commentable, polymorphic: true
has_many :comments, as: :commentable

I probably have to do something with recursion

(as discussed here: https://stackoverflow.com/a/35248329/6430382 )

Someone said: https://gorails.com/episodes/counter-caches but that is only 1 level deep as far as I can see.

Please advise

Posted in What are your goals for 2018?

Goals for 2018:

  • visit gorails.com and watch episodes in my spare time
  • build out my hobby project (comparison website)
  • get a better understanding of the basics
  • a minimum of 1000 hours of dev time.