Noel Rappin Writes Here

Tag: rails

TypeScript and jsbundling and Rails 7

This is a quick bit of service journalism about one thing that seemed less than obvious about converting the code in Modern Front-End Development For Rails to Rails 7.0, namely how to integrate TypeScript with the new tools. Specifically, the Rails 7.0 version of the code ditches Webpacker in favor of the new jsbundling-rails and cssbundling-rails gems and uses esbuild instead of webpack. See here for an only-slightly out-of-date description of the new tools.

Rails 7 and JavaScript

Or: Rails and JavaScript, Part 5 A quick program note: If you like this newsletter, you might like my recent books: “Modern Front-End Development for Rails” (Ebook) (Amazon) and “Modern CSS With Tailwind” (Ebook) (Amazon). If you’ve already read and enjoyed either book, I would greatly appreciate your help by giving a rating on Amazon. Thanks! If you are really interested in how we got here, I wrote about the history of Rails and JavaScript, read Part 1, Part 2, Part 3, and Part 4.

Databases and Validation and Uncertainty

A long time ago, I studied research on what makes successful engineering teams. (Not programmers, other engineering fields). I don’t remember a lot of it, but one phrase stands out: “preserving ambiguity”. Successful teams don’t make decisions that aren’t needed, and they don’t get themselves locked in too early. One fact about the beginning of a project is that you know less about the project than you ever will. And yet teams are often asked to provide estimates, do architecture, and make long-ranging plans at the beginning of the project when it is guaranteed that some of the assumptions will be wrong.

Okay, This One Is About Stimulus

Previously On Locally Sourced: I wrote about Hotwire and Turbo, the Rails client side New Magic. Then I wrote about them again. I think you are all caught up. I’ve been writing about Hotwire and Turbo, and haven’t said all that much here about Stimulus. Which is a tool that I like so much, that after using it on a project, I literally decided to write a book so I could tell more people about it.

What I Like About Hotwire

Previously On Locally Sourced: I wrote about how to use Hotwire and Turbo. (My Mac keeps wanting to autocorrect that to “Hot-wire” for some unknown reason…). The update to Modern Front-End Development With Rails is ongoing, the book is available for beta purchase if you want the new stuff as soon as we can get it to you. After writing a post a couple of weeks ago explaining how the new Hotwire framework works I want to spend some time explaining what I like about it.

A Brief Hello to Hotwire and Turbo

This week, after some mysterious announcements about “New Magic”, Basecamp released Hotwire, their support tools for client-side development using HTML over the wire rather than JSON. These are the generic versions of the tools that power Hey. Hotwire consists of the already released StimulusJS, and Turbo, which is the successor to Turbolinks. This is also the tool release that has been holding up Modern Front-End Development With Rails, on sale now!

Rails and JavaScript, Part 4: The Future?

It’s hard to predict… Previously on Locally Sourced: Well, we’ve been talking about the history of Rails and JavaScript: part 1, part 2, and part 3, and we’ve finally caught up to the present time, so I guess it’s time to talk about the future. Also, my Rails and JavaScript book is still on sale. You might want to buy it. This is all a little speculative, based on the are changes that have been made to Turbolinks and Stimulus that are clearly in use in Hey.

Rails and JavaScript: Part Three

The Webpackening Previously on Locally Sourced: Rails came out and let people do Ajax, when Ajax was a thing. Then Ajax was less of a thing and Rails let people write CoffeeScript, and use Sprockets. Also, I wrote a book on Modern Front-End Programming with Rails, which is relevant to this edition. The Rails 5 and 6 releases have had a few big JavaScript components, with one more presumably imminent. With Rails API and Webpacker, Rails made a big move toward allowing better interoperability with the JavaScript ecosystem.

Rails and JavaScript Part 2

UJS, CoffeeScript and Sprockets, oh my. Previously on Locally Sourced: I wrote about the early years of Rails and JavaScript. Which made it to Ruby Weekly. Also, my Rails and JavaScript book is still on sale. A quick program note: If you’ve liked the Entropy Essays, I’m doing a virtual Chicago Ruby Meetup on July 7th at 6:00 Central Daylight Time. It’s being streamed via zoom, and you can sign up here.

Rails and JavaScript: Part 1

You got your Rails in my JavaScript… Previously on Locally Sourced: Well, in 2005 I came across a cool web framework called Ruby on Rails. More recently, I wrote a book about integrating Rails and front-end tools. If you want, you could buy it. Today, I thought I’d go back to the beginning… Over the fifteen or so years that Rails has been around, the relationship between Rails and client-side JavaScript has gone in many different directions.

Rails, Objects, Tests, and Other Useful Things

For the first time in quite a while, I’ve been able to spend time working on a brand-new Rails application that’s actually a business thing and not a side project. It’s small. Okay, it’s really small. But at least for the moment it’s mine, mine, mine. (What was that about collective code ownership? I can’t hear you…) This seemed like a good time to reflect on the various Object-Oriented Rails discussions, including Avdi’s book, DCI in Rails, fast Rails tests, Objectify, DHH’s skepticism about the whole enterprise, and even my little contribution to the debate.

Setting Up Fast No-Rails Tests

The key to fast tests is simple: don’t do slow things. Warning: this post is a kind of long examination of a problem, namely, how to integrate fast non-Rails tests and slow Rails tests in the same test suite. This may be a problem nobody is having. But having seen a sample of how this might work, I was compelled to try and make it work in my toy app. You’ve been warned, hope you like it.

Cucumber Rails 0.4: The De-Web-Step-ining

Consider this part of an occasional series where I attempt to revisit tools discussed in Rails Test Prescriptions that have undergone some revision. (NOTE: Most of this was written before the DHH Twitter-storm about testing this week. For the purposes of this post, I’m choosing to pretend the whole thing didn’t happen.) The cucumber-rails gem released version 0.4 last week, which had some significant changes, and intensified what we might call the opinionated nature of Cucumber over what a Cucumber scenario should look like.

Creating, Sending, and Verifying CSV files using Comma

Here’s something I haven’t done in a while – a genuine code blog entry. I needed to add a simple CSV file output, here’s how I did it, tests and all. I used two gems, FasterCSV, which I assume that most of you are familiar with, and Comma, which is a nice little DSL for specifying CSV formats. (Thanks again to Jason Pearl for reminding me what the gem was called…).

July 26, 2010: A Hammer, A Nail, and A Giant Squid

Book Status Beta 5 should be out early this week, featuring a mostly new chapter on testing legacy projects, and also updating the code setup and the initial walkthrough chapters to Rails 3. Over the next couple betas any remaining Rails 3 incompatibilities will also be fixed. Book Reviews Something new for you on a Monday, a couple of novels that I liked in the last couple of weeks. Kraken, by China Mieville.

July 21, 2010: This Code Belongs In A Museum

Status Not much to tell, really. Spent some time getting RVM set up, since I think I’ll need it to manage simultaneously building the Rails 2 and Rails 3. Now I have a working version of the startup appendix that uses Rails 3 and Devise. I can’t speak to using Devise in practice yet, but the immediate goal of making the setup less complicated was definitely accomplished. The big question now is how much to support Rails 2 in the walk-through chapters.

July 6, 2010: Opinions are Bad For Business

The title, by the way, is from a favorite scene in a favorite movie. Status Now definitely working on the “dealing with legacy code” chapter, which I am hoping will be substantially more useful than the Lulu version, in that it will cover a few more techniques. I should know later today what the timeline is for beta 4. Links Let’s see what we’ve got today. Nick Quaranto over at Thoughtbot wants you to stop leaving time bombs in your tests.

June 21, 2010: Double Double Splat Splat

Link post today. Turns out I built up more links than I thought. Book Status Somehow I wound up writing and editing the Rcov chapter, which, among other things, is the first time I’ve had to wrestle with RSpec 2 vs. RSpec 1 behavior, when writing about how RSpec and Rcov get along. Now I need to figure out how to write about that more coherently. Actually, I need to decide if I’m going to acknowledge RSpec 1 at all.

June 8, 2010: iPhone, iPhone, it's off to work iPhone

Okay, There’s a New iPhone Don’t really have a whole lot to say beyond what’s already been said. It looks very slick, and if anybody can actually pull off getting people to use video chat, it’s Apple. The form factor of video chat from a phone seems at first glance to be significantly better than from either a laptop or the iPad, in that it seems easier to hold the phone in a position to get a good angle.

June 3, 2010: Get your Kicks on Route resources :user

Routes Geoffrey Grossenbach at Peepcode posted a typically beautiful post/rant about Rails routing. DHH responded in the comments of the article on YCombinator. Grossenbach argues that Routes are unnecessary configuration and offers a couple of options for moving the routing into the controllers, as Sinatra does. DHH responds that GG’s schemes would be challenging for large projects, and that the seven default action names are an important constraint. Everybody’s making good points here, so lets have the debate.

May 28, 2010: Friday Friday Friday

Short today, but preparing some longer, more rant-y bits for the future… Book status Not much forward motion for the next few days, as I have a lot of other stuff to do, including preparing for Chicago Ruby on June 1 and doing a bit of touch-up on Obtiva’s 4-Day Ruby on Rails/TDD boot camp. All fun, but time consuming. Some Links A quick tutorial by Peter Cooper on setting up JQuery in Rails 3.

May 26, 2010: Answer The Question Please

Top Story Got interviewed yesterday by Miles Forrest and Curtis McHale of the coderpath podcast. Presumably it’ll be out and public in the next couple of weeks. You’ll be the first person I tell. Couple things It’s been a while since I did anything like this, and I always forget how much it’s a genuine skill to be able to give a clear answer without doing a lot of ums and ahs.

May 25, 2010: Betas

Top Story Beta 3 should be out today. The main change in this Beta is the inclusion of the Cucumber chapter, which has been updated both in terms of new tech, and also in terms of conclusions about how to use Cucumber. And In Rails news… When last we met, Rails 2.3.6 had just been released. Well, in the intervening 24 hours, we’ve bumped all the way to 2.3.8, with two bug fix releases, explained by Jeremy Kemper here and here.

May 24, 2010: Martin Gardner

Top Story Rails 2.3.6 released, with more changes than I expected, taking it just a little bit beyond a bug-fix release. Follow the link for the full release notes. Things that caught my eye: Looks like they made an official plugin to give Rails 2.3.6 the default HTML safe behavior of Rails 3. Although the note is vague and I could be misunderstanding. Alert and notice are now separate methods rather than just being keys on the flash.

May 20, 2010: Fontastic

Book Status Starting to sound repetitive. Still working on the Cuke chapter, this time focusing on cleaning up the parts where I recommend ways to use Cucumber. Still hoping for a beta early next week. Other things This week in Yehuda, there’s a very long article about text encodings and what problems they have, and in particular how Ruby’s implementation is shaped by the complicated relationship between Unicode and Japanese.

May 4, 2010: MacRuby and more

Top Story MacRuby 0.6 is out. Big new features include a debugger, a new interface to Cocoa’s Grand Central Dispatch, and a rewrite of the internals of basic Ruby classes. In a related story, the early text of Matt Aimonetti’s MacRuby book from O’Reilly is available for free online. Nice job all around. I’m not sure if I’ve mentioned it here, but I use MacRuby and its ability to manipulate AppleScriptable programs to power my crazy-obsessive iTunes random playlist generator, so speed improvements are hoped for.

April 19, 2010: The Week Begins

Top Story/Book Status This is the week – Rails Test Prescriptions should go on beta sale on Wednesday. In a related story, railsrx.com now points to here, railsprescriptions.com also will shortly. I’ll be adding some basic about information and static pages here. At some point, I’ll probably bring over any blog content from the previous site that still seems relevant. I’m not sure if the original free version of Rails Test prescriptions will still be available (it’s becoming out of date, and there will be free samples available at Pragmatic), but I will make it available if anybody is still interested.

April 16, 2010: The cover is uncovered, at least for me...

Top Story and Book Update I have sample cover designs. I don’t think I can show them yet, but I’ve got ‘em, I like them, and hopefully we’ll have picked one to show shortly. Tab dump Not a whole lot today: Here’s a look at the current status of using a non-blocking MySQL driver with Rails. The promise here is for significantly faster database access. Two stories that are related to projects that I worked on back in my EdTech days:

Ruby on Rails article

Just a quick mention that part 1 of my article series on using Rails to write iPhone apps is online at IBM Developerworks. Parts 2 and 3 will be published sometime in the rather near future. In other notes, Pathfinder has updated the company blog URL to http://www.pathf.com/blogs. Individual authors now have unique pages, I’m http://www.pathf.com/blogs/noel rappin. Recent pieces there include a quick welcome to RailsConf, and a two-part article on HTML and code markup in Rails, available here and here.

Rails Development for iPhone with rails_iui

I’ve been doing some web development for iPhone and Mobile Safari lately, not least because of a series of articles that will be showing up in IBM DeveloperWorks soon. I was using the iUI toolkit, which contains a number of CSS styles and JavaScript event handlers to make iPhone Web apps look and feel somewhat like native iPhone applications. As I was working with iUI, I realized I was building up a library, so I converted everything to a Rails plugin: rails_iui.

Quick Program Notes

A couple of updates on book and article news… It looks like the screencast/video thing is going to happen, thanks to Jim Minatel. The main constraint is that they’d like the videos to be about five minutes long. I think the first one will be setting up a Rails project in Subversion (chapter 2 of the book, essentially), and I’d do a remix of that chapter using Git if there’s interest.

Two Parter on Hide And Seek

Two articles on the Pathfinder blog on adding show and hide toggles to a Rails application: http://blogs.pathf.com/agileajax/2008/04/hide-and-go-see.html http://blogs.pathf.com/agileajax/2008/04/hide-seek-and-s.html

Video Still Working On Killing The Radio Star

Annnddd… This, of course, is what I get for posting anything about Wiley late at night without checking. Jim Minatel from Wiley added the following comment: Noel: I’m interested in getting Wrox authors to to videos related to their books…. I can tell you what’s involved and see what we can do. So, contacting in progress. Further bulletins as events warrant. Or as events don’t warrant, I think further bulletins are inevitable.

Pathfinder Post: Using Null Objects with ActiveRecord

Enjoy: http://blogs.pathf.com/agileajax/2008/03/using-the-null.html

Using Active Record For Migrations

New post on the pathfinder blog: Using ActiveRecord to Migrate Legacy Data Enjoy!

Buy My Book! (Please?)

![223888 cover_df.pdf (3 pages).jpg](http://blogs.pathf.com/agileajax//223888 cover_df.pdf (3 pages).jpg)This week, my book Professional Ruby on Rails will be officially released. You can see sample chapters here, and you can buy the book at Amazon (affiliate link). This book is designed to meet the needs of an intermediate to advanced Ruby on Rails user. The first wave of Rails books could not assume that the user had any pre-existing knowledge of Rails. As a result, they spent a lot of time covering the basics.

Hey, Free Book Samples!

As I’ve mentioned here a few times, I have a book coming out, “Professional Ruby on Rails”, available later this month. If you’d like a sneak peek, Wrox has put some samples online as PDF files. You can also just buy the book. Chapter 1 – This sets up the sample project used in the book, and talks about the new REST features in Rails. Table of Contents – Take a look at this to see if your favorite topic is covered.

Publication And Other Updates

First off, several pathfinder blog posts to catch up on… A two part series on a quick little testing tool that I wrote called testbed. Part 1. Part2. Predictions for 2008 How to test custom form builders in RSpec. I wrote this in the hope that somebody else won’t have to spend two hours Googling this. Coming soon, “Why I stopped using RSpec…” My contribution to a discussion on duck typing, Save the Duck!

Versions: Another promotion from the comments

Somebody anonymous asks: As most of the currently available books cover Rails 1.2, are you providing the code in the books also as Rails 1.2? The sample example in the book is Rails 2.0, which was Edge Rails when I started, and I just validated all the tests against 2.0.2 last week when I turned in the finished code samples. Where there’s a significant change between 1.2 and 2.

Professional Rails Online?

In response to the commenter who asked if there was going to be a beta book. UPDATE: Clearly I should ask about these things before I post. Jim Minatel from Wrox added the following in comments: There will be a PDF about six weeks after the print book, meaning end of March or thereabouts. There will also be an Amazon Kindle version, eventually. Also after 6 weeks, the book will be available via Wrox’s online subscription service: http://wrox.

Another Publication Update

Just got the next version of the book chapters for my examination. I’m not 100% sure exactly where these fit in the process. It looks like they’ve had a good look-see from a copyeditor, largely for style, clarity, and consistency. (Any lingering “we” sentences seem to have been pruned, for example). They produced a book-specific style guide, which is a listing of canonical forms for things like plugin names, capitalization of commands or tools and the like.

Things I Learned

Some things I learned about Rails and writing while working on this book: The great benefit of working on a project like this book is that it enabled me to compress about two years worth of research into Ruby and Rails tools into six months. In my case, this was a great opportunity to really dig into some tools to find that I’ve only been using a fraction of their power and also really get a sense of how elegant and flexible the tools are.

We're In Production Now...

I turned in the last chapter of Author Review on Monday, and Professional Ruby On Rails is now in production. Target release date is still mid-February, final page count will be in the range of 450. I was able to keep the test-first nature of the code going through nearly all of it, which I’m really happy with. The table of contents looks something like this (in theory, still subject to change…)

Heads Up

Wow, I haven’t been here for a while. Sorry about that. Here’s the deal… The Rails book initial draft went in about a week ago, more or less on time. (Well, on time for a slightly revised schedule). My understanding of the current schedule is that the author review phase will continue through November. After that, it goes to production, where I get another crack at revising thing that have changed.

Quick Book Update

Couple quick things while I have a minute… Just turned in Chapter 10 (of 16) of the Rails book. Still mostly on schedule for a turn in on October 26, not quite sure what that implies for a print date As I write this, the wxPython book is at 11 thousand and change on Amazon, the highest I’ve seen in months, which is probably a fluke. Weirdly Amazon says it’s the #15 book on “Website Architecture & Usability”, which would be great if it was, you know, actually about website architecture usability…

Pro Rails Book Related Things

A few things I forgot to put in the last book update: The Amazon listing has the book at 600 pages. That’s almost certainly optimistic. The contract calls for 400-500. As far as the schedule goes, I’m currently hoping to turn the complete draft in on October 26th, which is about ten days after the original date. The publisher says that pushes publication out to April, six to eight weeks after the original date.

The Rails Edge

I was fortunate enough to attend Pragmatic’s Rails Edge mini-conference here in Chicago last week. I have two blog posts up on this at Pathfinder, the first is made up of quotes from my notebook, and the second is some general thoughts. Enjoy.

Book Update

Here’s a couple notes on the current status of the Rails book and life in general. The Rails book is presently just about 30% done – first payment triggered (yay!). I’m reasonably happy about it so far, though definitely too close to it at the moment to have a clear sense of its quality. I do like the way the test integration is working out – it seems to help my descriptions of functionality to have the tests there.

A Little Birdie Told Me

In the interests of being able to push out quick updates on the book’s progress, I’ve created a Twitter account for the book. You can follow that account on the sidebar of this here blog, or at http://twitter.com/noelrappinbook – there’s also an RSS feed. Please remember that any and all information about the book is subject to change at whim. Enjoy.

Book Updates

It’s been about a week or so of continued radio silence, so I thought I’d pop in with an update. I’m in the middle of chapter three of the Rails book. I think it’s going well, but nobody other then me has read the chapters yet, so that’s easy to say. My first milestone date is the end of the month, and four chapters done – that’s about one-quarter of the entire book.

Announcing: Professional Ruby on Rails

I’m pleased to be able to say that I’ve contracted for a new book, Professional Ruby on Rails, scheduled to be available in “early 2008”, hopefully February or March. The publisher is Wiley, through the Wrox imprint – the ones with the red covers and the author’s picture on them. Wiley wanted me to be sure and mention that the ISBN number is 9780470223888, so you’ll be ready to pre-order it the second that becomes possible.

Web Apps and Language Wars

I wasn’t planning on posting about either web apps or linking to Joel Spolsky again, but this language wars post is just too interesting to pass up. Besides, a jillion people have already commented on this, so what’s a jillion and one? Spolsky is riffing on what language or platform you should use for an enterprise web project. He makes a few points (note, I’m paraphrasing him here – these are his points, not mine):



Copyright 2024 Noel Rappin

All opinions and thoughts expressed or shared in this article or post are my own and are independent of and should not be attributed to my current employer, Chime Financial, Inc., or its subsidiaries.