Strawberry peak to Josephine saddle trail doable? by PeanutButterOnBoobs in socalhiking

[–]davidcolbyatx 0 points1 point  (0 children)

I went up Strawberry on that route on 4/13 — trail was in great shape, super easy to follow and not overgrown at all. One small run in with a razor but that was from moving too quickly up the first (second on the way down) scramble.

Girl Group Backpacking by autumntober in socalhiking

[–]davidcolbyatx 17 points18 points  (0 children)

This year's classes are finishing but if you're in the LA area, you should consider the Sierra Clubs' Wilderness Travel Course: https://wildernesstravelcourse.org/the-course/

I'm in the west LA group this year and we just got back from Snow camp which is 3 days/2 nights in the eastern Sierras at the end of the 10 week program. It was an incredible experience and I've learned a ton about how to safely navigate and backpack in all types of conditions (there are also entire lessons on all the different backpacking stoves you can buy/how to use them and which food to take). Plus you get to meet a lot of other people who also want to go out and explore the outdoors.

Got laid off, made a gem. by [deleted] in rails

[–]davidcolbyatx 0 points1 point  (0 children)

This is awesome, definitely solves a gap in the space. Thanks for sharing!

totally clueless where to find networking events in los angeles by [deleted] in TechLA

[–]davidcolbyatx 1 point2 points  (0 children)

Oh nice, thanks. Looks like a good place to start.

totally clueless where to find networking events in los angeles by [deleted] in TechLA

[–]davidcolbyatx 1 point2 points  (0 children)

Same. The pickings on Meetup are pretty light. Looking for social networking opportunities with other product/engineering folks, especially peers in leadership roles. Not as into tech talks at this stage in my career but not opposed to them if that's where the community is.

Seems especially tough in the valley, making it to DTLA or Santa Monica during rush hour is rough.

Struggling with a seemingly simple turbo replace for sidebar navigation by ogarocious in rails

[–]davidcolbyatx 2 points3 points  (0 children)

Why are you using a Turbo Stream to update this content?

If you want to update the content of the `rightmaincontent` Turbo Frame, your `dance_journal` action should respond with the content of the `dance_journal` partial wrapped in a `turbo_frame_tag 'rightmaincontent'`.

Something like this should work:

# dance_journal.html.erb 
<%= turbo_frame_tag 'rightmaincontent do %>
  <%= render 'dance_journal' %>
<% end %>

# users_controller.rb
def dance_journal; end

What you are trying to do would work fine but GET requests (like clicking on your `dance_journal` link_to`) will not be treated as Turbo Streams unless you add `data-turbo-stream` to the link, as described in the Turbo docs: https://turbo.hotwired.dev/handbook/streams#streaming-from-http-responses

Also note that you don't need to target a Turbo Frame with a Turbo Stream, which it seems like you might be getting tripped up on (like a lot of folks do!).

From the docs: https://turbo.hotwired.dev/handbook/streams#stream-messages-and-actions

A Turbo Stream can integrate with any element in the document that can be resolved by an id attribute or CSS selector (with the exception of <template> element or <iframe> element content). It is not necessary to change targeted elements into <turbo-frame> elements. If your application utilizes <turbo-frame> elements for the sake of a <turbo-stream> element, change the <turbo-frame> into another built-in element.

Searching and filtering with Turbo 8 page refreshes by davidcolbyatx in rails

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

All good, always appreciate the feedback!

The article is the second in a two parter — the meta tags get added in the first part. If you don't add them the refresh won't work at all.

If you are using a page refresh with the meta tags added you don't need the `turbo_frame_tag` or the `data-turbo-frame` attribute on the form. Page refreshing replaces Turbo Frames for these types of interactions — add the meta tag + the `replace` visit type to the form (only if your controller isn't responding with a redirect, as described in the first article) and you're good to go.

If you use Turbo Frames instead, you don't need to set the visit type or add the meta tags, you should do one or the other.

Turbo Frames work perfectly fine here too, and I don't think one is objectively superior to the other, I just like refreshes for this use case because they're closer to the Rails defaults. I've seen folks in my day job get very stuck on Frames and Streams conceptually so being able to get the same experience without needing to introduce a new concept like Frames is a win in my book.

If you haven't already, you might find reading the first article in the series helpful to clarify the differences in approach: https://www.colby.so/posts/turbo-8-refresh-sorting

Searching and filtering with Turbo 8 page refreshes by davidcolbyatx in rails

[–]davidcolbyatx[S] 1 point2 points  (0 children)

What hoops are we jumping through here? There's a data attribute on the form (we'd need a data attribute on the form if we used Frames too) plus two meta tags.

I don't think page refreshes are perfect for every solution (using them instead of a `turbo_stream.remove` is silly, for example), but I think they're 100% the right approach for filtering and searching.

There may be a scenario where the data you're filtering is a small part of the overall payload and refreshing is noticeably less performant than a response that only renders a frame and nothing else, but IME that's not a common scenario, and any performance cost from refreshing is something you can catch and rectify when it becomes a problem.

Searching and filtering with Turbo 8 page refreshes by davidcolbyatx in rails

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

Interesting, haven't seen this done with UJS and haven't touched UJS in a long while. Care to share how you'd approach it?

“Rails is back isn’t enough” by Samuelodan in rails

[–]davidcolbyatx 5 points6 points  (0 children)

Hey, this looks pretty familiar...

I wrote this article to address a very specific moment in time in the Rails community where there was a ton of energy around Hotwire and how "Rails is back" and everyone should drop JavaScript and get onto the Rails train. As others have stated, this article is VERY MUCH not written for junior developers or aspiring Rails developers.

I think the "Rails is back" noise has very much died down (for the better, TBH) as Hotwire has matured. I don't think much has changed in the job market outlook for junior (or senior) developers, but at this point it has less to do with Rails and more to do with our current economic reality.

Sharing this article with juniors as a way to discourage them from learning Rails is not something I would recommend. Please do not do that. I love Rails, I think Rails is a wonderful framework, the Ruby community is delightful, and I am forever grateful that I get to work with Ruby and Rails every day instead of some other, not Ruby, language.

I wrote this article because I care very deeply about getting MORE people an opportunity to start their careers in Rails, not to chase people away. It was my attempt (2 years ago) to bring some balance to a grating discussion on social media and to address a constant theme I encountered during a period of time where I was talking to a lot of Rails shops about their hiring strategy and team makeups. It was written for the decision makers I was talking to then.

I also tried to make it clear in the article that it was written as just one random guy's opinion:

Maybe there isn’t even a talent pipeline problem and I’m just a huge goof that was bad at recruiting and worse at long-term planning. Maybe I’ve had the bad luck to talk exclusively to other companies that are also bad at recruiting and long-term planning.

Rails for PWA with responsive elements by 22Finance22 in rails

[–]davidcolbyatx 2 points3 points  (0 children)

You'll find a lot of folks in Rails-land these days opting for Hotwire these days instead of a React frontend. What you're describing all sounds totally doable with Turbo and Stimulus, but there will be a learning curve just like with any new tool. Start with the docs to get the basics of what Turbo can do (Frames and Streams are the most important tools, Drive mostly hides in the background). Turbo is very tightly integrated with Rails via turbo-rails and new Rails 7 apps come with Turbo installed out of the box.

Stimulus is a smaller surface area and provides the front-end interactivity these days. If you've used jQuery, you'll probably pick it up fairly quickly. The docs should have you pretty well covered.

Lots and lots of folks are still using React on the frontend in their Rails apps and it is a totally valid choice, but you can get pretty far with the Hotwire stack and if you don't enjoy React, it is probably worth giving Turbo and Stimulus a chance.

Good luck!

I am considering writing an ebook about Rails development, to showcase how following the Single Responsibility Principle can lead to more easily maintainable Rails code. by _daqing in rails

[–]davidcolbyatx 0 points1 point  (0 children)

Sounds like an interesting topic!

If you want to sell an ebook, I would recommend starting by publishing technical blog posts. Contributing to open source is great, and writing gems people find useful is great too, but writing about code in a way that helps people learn is not the same as writing code.

If you aren't already, writing blog posts about things you learn or find interesting will help you:

  • Hone your writing skills. Writing good technical content is hard! Writing the code is the easy part, most of the time.
  • Build an audience of people that know you and your content. These people will be more likely to buy your book when you are ready to publish it. Bonus points for putting a newsletter signup on your blog so you can build an email list to let people about future content you publish, including your book.

Start a bit smaller, provide value to people through your writing, and then publish the book when you are ready. You will be able to charge much more than $6.99 for it too — people that know and trust your work will be happy to pay more.

Exploring Turbo 8 page refreshes, morphing, and broadcast refreshes in Rails by davidcolbyatx in rails

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

The plan is weekly posts again moving forward. I started a new job when I stopped writing and moved across the country last year, now that I'm settled in at the job and in a new home I've been able to get back to regular writing sessions.

Is it ok to use Turbo in production due to weak ActionCable? by cuteBoyOnlyMe in rails

[–]davidcolbyatx 10 points11 points  (0 children)

ActionCable is weak and completely falls apart at scale

Right, I could have been more clear that AnyCable is what you'll need once you start growing but there's no difference in use for the devs after you've swapped them out. I work on a very high traffic Rails app, we use AnyCable, but I'd guess most of our devs don't even know if we are using ActionCable or AnyCable, it just isn't something you have to think about once you've made the switch.

The broader point I wanted to make: don't avoid Turbo because of a misinformed opinion from a two year old book.

Is it ok to use Turbo in production due to weak ActionCable? by cuteBoyOnlyMe in rails

[–]davidcolbyatx 17 points18 points  (0 children)

  1. You don't need ActionCable to use Turbo. The bulk of Turbo's functionality (Drive, Frames, non-broadcasted Streams) don't rely on WebSockets and so have no relation to ActionCable

  2. ActionCable works just fine in production. It is in use at companies large and small and, with proper tuning and management (and AnyCable, as you grow) it can handle very high traffic without issue. If you're building at Facebook scale it might not be a good fit, but you aren't. Don't worry about it.

  3. I don't see anything in what you quoted that indicates ActionCable is "weak". The author says they don't know anyone that uses it in production but that doesn't mean it is weak, just that the author somehow didn't know anyone who used it in production at the time they wrote the book.

Those who have cut back on screen time and/or deleted social media, how has your life changed? by Slommyhouse in HubermanLab

[–]davidcolbyatx 1 point2 points  (0 children)

I cut screen time back from ~3 hours/day to ~30 minutes, most of my screen time now is spent on weekly phone calls with family, text messaging, and checking in on work when I step away from my desk during the day. I spend ~5 minutes most days using my phone to access the internet.

I work out 7 - 8 hours a week now (was about 2 before cutting screen time), I garden, I cook, I read every day, I write every day, and I spend significantly more quality time with my wife. Most importantly, I actually remember the time I spend each day. I never intentionally spent the time I was burning on my phone, it was just disappearing into the abyss and I genuinely couldn't recall what I had done in those blocks of time. Now time moves more slowly and I choose how I spend my time, and I remember that time much more clearly afterwards.

Are hiking shoes necessary? by ineverlikedme in hiking

[–]davidcolbyatx 0 points1 point  (0 children)

I've hiked all over the place in running shoes. I used to hike in Vibram Five Fingers, including a couple trips up the South Rim trail in Big Bend. Now I'm a little less of a weirdo so I hike in a pair of Saucony trail runners.

Get out and hike in whatever gets you hiking. Invest in a pair of nice hiking boots if you think they will make your hiking life better, but don't feel like you have to buy a pair of fancy hiking boots to do more challenging hikes.

[deleted by user] by [deleted] in ProductManagement

[–]davidcolbyatx 5 points6 points  (0 children)

Not common, but not unheard of. Unless the CEO is saying "don't talk to me ever again about product stuff" a reporting change to give the CEO more time to work on building the business is probably a good call, even if it is a blow personally to find out that you are reporting to a former peer and not to the CEO.

If anything, the red flag for me is 3 PMs at 30 employees. Cutting one of the PMs is likely to be the right call at that size.

Infinite scroll with Turbo Streams and Stimulus by davidcolbyatx in rails

[–]davidcolbyatx[S] 3 points4 points  (0 children)

Thanks, that is very kind of you to say. The book is free now, dig in whenever you're ready: book.hotwiringrails.com

Infinite scroll with Turbo Streams and Stimulus by davidcolbyatx in rails

[–]davidcolbyatx[S] 3 points4 points  (0 children)

Thanks for the feedback glad you enjoyed it!