Posts tagged: rails
52 posts
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_][1] 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...
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](https://pragprog.com/titles/nrclient/modern-front-end-development-for-rails/)) ([Amazon](https://amzn.to/37HzR27)) and "Modern CSS With Tailwind" ([Ebook](https://pragprog.com/titles/tailwind/modern-css-with-tailwind/)) ([Amazon](https://amzn.to/3xME2V5)). If you've already read and enjoyed either book, I would greatly appreciate your help...
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...
Okay, This One Is About Stimulus
_Previously On Locally Sourced: I [wrote about Hotwire and Turbo](https://noelrap.substack.com/p/a-brief-hello-to-hotwire-and-turbo), the Rails client side New Magic. Then I [wrote about them again](https://noelrap.substack.com/p/what-i-like-about-hotwire). 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...
What I Like About Hotwire
*Previously On Locally Sourced: I wrote about [how to use Hotwire and Turbo](https://noelrap.substack.com/p/a-brief-hello-to-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](https://pragprog.com/titles/nrclient/modern-front-end-development-for-rails/) is ongoing, the book is available for beta purchase if you want the new stuff as...
A Brief Hello to Hotwire and Turbo
This week, after some mysterious announcements about "New Magic", Basecamp released [Hotwire](https://hotwire.dev/), 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](https://hey.com). Hotwire consists of the already released StimulusJS, and Turbo, which is the successor...
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](/blog/2020/06/rails-and-javascript-part-1/), [part 2](/blog/2020/07/rails-and-javascript-part-2/), and [part 3](/blog/2020/07/rails-and-javascript-part-three/), 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...
Rails and JavaScript: Part Three
## The Webpackening _Previously on Locally Sourced: Rails came out and let [people do Ajax](/blog/2020/06/rails-and-javascript-part-1/), when Ajax was a thing. Then Ajax was less of a thing and Rails let people [write CoffeeScript, and use Sprockets](/blog/2020/07/rails-and-javascript-part-2/). Also, I wrote a book on [Modern Front-End Programming with Rails](https://pragprog.com/titles/nrclient/modern-front-end-development-for-rails/), which is relevant...
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](/blog/2020/06/rails-and-javascript-part-1/). Which made it to [Ruby Weekly](http://rubyweekly.com). Also, my [Rails and JavaScript book](https://pragprog.com/titles/nrclient/modern-front-end-development-for-rails/) is still on sale._ _A quick program note: If you’ve liked the [Entropy Essays](/tags/entropy/), I’m doing a...
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](https://pragprog.com/titles/nrclient/modern-front-end-development-for-rails/). Today, I thought I’d go...
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...
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...
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...
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](http://github.com/crafterm/comma), which is...
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...
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...
July 6, 2010: Opinions are Bad For Business
The title, by the way, is from a favorite scene in a [favorite movie](http://www.imdb.com/title/tt0053946/). ### 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...
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...
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...
June 3, 2010: Get your Kicks on Route resources :user
### Routes Geoffrey Grossenbach at Peepcode posted a typically beautiful post/rant [about Rails routing](http://blog.peepcode.com/tutorials/2010/rethinking-rails-3-routes). DHH [responded in the comments of the article](http://news.ycombinator.com/item?id=1398903) 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...
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](http://www.meetup.com/ChicagoRuby/calendar/12674321/) and doing a bit of touch-up on [Obtiva's...
May 26, 2010: Answer The Question Please
### Top Story Got interviewed yesterday by Miles Forrest and Curtis McHale of the [coderpath podcast](http://coderpath.com/). 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...
May 25, 2010: Betas
### Top Story Beta 3 should be [out today](http://pragprog.com/titles/nrtest/rails-test-prescriptions). 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...
May 24, 2010: Martin Gardner
### Top Story [Rails 2.3.6 released](http://weblog.rubyonrails.org/2010/5/23/ruby-on-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...
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...
May 4, 2010: MacRuby and more
### Top Story MacRuby 0.6 [is out](http://www.macruby.org/blog/2010/04/30/macruby06.html). 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](http://macruby.labs.oreilly.com/) for free online....
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...
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...
Ruby on Rails article
Just a quick mention that [part 1 of my article series on using Rails to write iPhone apps](http://www-128.ibm.com/developerworks/opensource/library/os-eclipse-iphoneruby1/) 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](http://www.pathf.com/blogs). Individual authors...
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](http://code.google.com/p/iui/), which contains a number of CSS styles and JavaScript event handlers to make iPhone Web...
Quick Program Notes
A couple of updates on book and article news... 1. 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...
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-and-go-see.html) [http://blogs.pathf.com/agileajax/2008/04/hide-seek-and-s.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...
Pathfinder Post: Using Null Objects with ActiveRecord
Enjoy: [http://blogs.pathf.com/agileajax/2008/03/using-the-null.html](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](http://blogs.pathf.com/agileajax/2008/03/using-activerec.html) Enjoy!
Buy My Book! (Please?)
[.jpg)](http://www.amazon.com/gp/product/047022388X?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=047022388X)This week, my book [_Professional Ruby on Rails_](http://www.amazon.com/gp/product/047022388X?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=047022388X) will be officially released. You can see [sample chapters here](http://www.wrox.com/WileyCDA/WroxTitle/productCd-047022388X.html), and you can [buy the book at Amazon (affiliate link)](http://www.amazon.com/gp/product/047022388X?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=047022388X). This book is designed to meet the needs of an intermediate to advanced Ruby on Rails...
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](http://www.amazon.com/gp/product/047022388X?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=047022388X). - [Chapter 1](http://media.wiley.com/product_data/excerpt/8X/04702238/047022388X.pdf) -- This sets up...
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](http://blogs.pathf.com/agileajax/2007/11/live-ruby-testb.html). [Part2](http://blogs.pathf.com/agileajax/2007/12/live-ruby-testb.html). - [Predictions for 2008](http://blogs.pathf.com/agileajax/2007/12/2008-the-year-i.html) - [How to test custom form builders in RSpec](http://blogs.pathf.com/agileajax/2007/12/rspec-and-rails.html). I wrote this in the hope that somebody...
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...
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...
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...
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...
We're In Production Now...
I turned in the last chapter of Author Review on Monday, and [Professional Ruby On Rails](http://www.amazon.com/gp/product/047022388X?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=047022388X) 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...
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...
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,...
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](http://blogs.pathf.com/agileajax/2007/08/the-rails-edge-.html), and [the second is some general thoughts](http://blogs.pathf.com/agileajax/2007/08/the-rails-edg-1.html). 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...
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](http://twitter.com/statuses/user_timeline/7587862.rss). Please remember that any and all...
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...
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....
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](http://www.joelonsoftware.com/items/2006/09/01.html) 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...