RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

DanielKehoe — 58 posts

Updating to Rails 4.2
I've written an article on Updating to Rails 4.2 which shows to install and manage multiple versions of Rails using RVM.
I've just released my book Learn Ruby on Rails on Amazon (it was only available with a RailsApps subscription before today). Even if you already know Rails, you might want this book. You can get Learn Ruby on Rails for only 99 cents for the next seven days (it's a launch promotion). And, please... write some 5-star Amazon reviews?
Register now for a workshop on Rails Advanced Techniques or a Rails introductory class, scheduled for January in Cape Town, South Africa.
Ready for a holiday side project? If you've got Rails 4.2, you can use Rails Composer to build a Stripe Checkout starter application that combines payment processing with Devise. Here's the Stripe Checkout Example application. There's also a tutorial.
I’m so delighted with the new Active Job feature I decided to release a new example application and tutorial right now, rather than waiting for Rails 4.2 final. Here's Mailing List with Active Job plus an article, Updating to Rails 4.2. Of course, you can build it with Rails Composer.
If you're upgrading to Mac OS X Yosemite, now's the time to update your Rails development environment as well. Here's my article on Installing Ruby on Rails on Mac OS X Yosemite.
I’ve added the Upmin admin framework to Rails Composer as an option. The upmin-admin engine provides an admin dashboard similar to Active Admin or RailsAdmin, so you can search, view, or update records without writing any code.
Role-Based Authorization in Rails
I’ve written an article on Rails authorization, showing how to implement simple role-based authorization, and comparing the Pundit and CanCan gems, with links to the rails-devise-roles example application, which you can generate with Rails Composer.
Do you know someone who teaches a class or workshop on Rails? I offer my book for beginners, Learn Ruby on Rails, to students enrolled in classes or workshops. See my blog post for details: ‘Learn Ruby on Rails’ Free for Students.
RailsApps Update for Devise 3.3
Devise default views now say “Log in” instead of “Sign in.” And the wording of error messages has changed. My blog post on the RailsApps Update for Devise 3.3 contains links for the details.
Now, when you build a Rails starter application with Rails Composer, you get the option of page-view tracking with either Google Analytics or (see a blog post for details). My article on Analytics for Rails explains everything Rails Composer adds, so there is no mystery code. Thanks to RailsApps subscribers for their project support.
Some developers have said they really want to restore the MongoDB/Mongoid option to Rails Composer. If that's you, consider joining a MongoDB Rescue Operation for Rails Composer.
I've just released a tutorial on Rails authorization with Pundit. I appreciate the support I'm getting from subscribers to the RailsApps project that makes it possible to write these tutorials.
Configuring RSpec
After writing an RSpec Tutorial, I released the RailsApps Testing gem which sets up the testing framework by tweaking a few configuration files for popular gems.
Rails 4.1 was released today and Rails Composer is up to date with 5 Starter Apps for Rails 4.1.
You can use Rails Composer, "the Rails generator on steroids," to create any of the Rails 4.1 starter apps from the RailsApps project, including a new application that combines Devise and Pundit with Bootstrap or Foundation.
The Rails and OmniAuth starter app is a new Rails 4.1 example from the RailsApps project, with configuration using the new config/secrets.yml file, and a choice of Bootstrap or Foundation front-end frameworks.
Devise example app for Rails 4.1
The Rails and Devise starter app is the first Rails 4.1 example from the RailsApps project, featuring the new config/secrets.yml, and a choice of Bootstrap or Foundation.
Rails Layout Gem
The rails_layout gem generates application layout files using Bootstrap or Foundation. My blog post on the Rails Layout Gem v1.0.1 release gives a sneak preview of a new Rails and Devise starter app that uses the rails_layout gem to generate Devise views using Bootstrap or Foundation.
Rails and Bootstrap
Resources for Rails and Bootstrap 3.0 from the RailsApps project, with links to an article about setting up Bootstrap and Rails, plus an in-depth tutorial, and a starter app on GitHub.
With help from Benedict Lee, we've improved support for Slim in Starter Apps from the RailsApps Project. Also you can choose from various versions of Bootstrap or Foundation for the front-end.
Rails Application Layout
I've updated the article Rails Application Layout which makes recommendations and offers advice. Comments welcome, especially suggestions for improvement.
Saturday is the last day to support the Kickstarter campaign for the new book Learn Ruby on Rails. Until Saturday, you can download the book for free. Please download it, take a look, and support the campaign.
Here's the new article: Install Ruby on Rails on Mac OS X Mavericks. Bookmark it for later, even if you are not updating to Mavericks this weekend. This is an article that goes in depth on what to install, what to update, and why.
Decisions, decisions. Which front-end framework? I chose Zurb Foundation for the "Learn Ruby on Rails" beginner's book. And both for the RailsApps project. Read the Twitter Bootstrap or Zurb Foundation? blog post for the details.
You can help Rails beginners by contributing to the Kickstarter campaign for the new book "Learn Ruby on Rails." Learn why I think the book is needed (though we are blessed with many other excellent tutorials).
Ruby on Rails with is a hosted development environment with a web browser IDE. You can actually do coding without any files on your laptop. I wrote an article Ruby on Rails with that shows how to get started and get productive.
Rails Bootstrap
Just added to the RailsApps repository: an example app for Rails 4.0 and Twitter Bootstrap. You can use the Rails Composer tool to generate a Rails 4.0 starter app set up with Twitter Bootstrap. Blog post here.
Rails Apps Composer on Guard
Paavo Leinonen added Guard as an option for continuous testing when using Rails Apps Composer. He describes his development environment, explains why Guard is useful, and how the Rails Apps Composer gem saves time building applications. The blog post is titled Rails Apps Composer on Guard.
In a blog post titled Project Gemsets with RVM I describe how RVM, the Ruby Version Manager, looks for files named .ruby-version and .ruby-gemset and loads the required version of Ruby and an appropriate gemset. RVM used to expect a .rvmrc file to perform the trick but Fletcher Nichol (@fnichol) evangelized to have a common convention among several Ruby version switcher utilities.
Updated Installing Rails tutorial showing how to set up both Rail 3.2 and 4.0 with Ruby 2.0. Uses some new features of rvm.
RailsApps Tutorials
I've launched the RailsApps Tutorials membership site. Here's the announcement which explains how subscriptions for tutorials will support the RailsApps open source project. The aim is more example applications, updated regularly, and more tutorials.
Updating Rails
Hopefully all Rails developers are now aware they should immediately upgrade to Rails 3.2.11 because of a recently announced security vulnerability. If you're reading RubyFlow, you likely know how to update Rails. However, for part-time and hobby developers, here's an article Updating Rails that offers instructions and advice.
The Rails Composer tool now offers a choice of Stripe or Recurly billing services when you choose to generate a membership/subscription/saas application. There's a "crazy deep" tutorial for each version: rails-stripe-membership-saas and rails-recurly-subscription-saas.
A new article from Taylor Mock and the RailsApps Project on Rails Environment Variables shows a bulletproof way to set local environment variables for use in your Rails application without using the Unix shell.
Just added to the RailsApps GitHub repo: an example app for a Rails Subscription (or SaaS) Site with Stripe Recurring Billing. it comes with a detailed Rails Tutorial for a Membership, Subscription, or SaaS Site. Like the other example apps in the RailsApps repo, this one uses the Rails Composer tool to generate a starter app, with options for Haml, creating a GitHub repo, and more.
What is the best way to add a JavaScript library to a Rails application? How to include external JavaScript files and jQuery plugins in the Rails asset pipeline. Using page-specific JavaScript in Rails. This in-depth article from the RailsApps project explains what to do when your application is not wholly Rails. Comments and discussion welcome.
What’s New in Rails Apps Composer: Rapid progress beyond version 2.0. It's the gem that gives you a tool to assemble a Rails starter application from a collection of recipes.
Rails Apps Composer 2.0 is out
The Rails Apps Composer gem gives you a tool to assemble a Rails application from a collection of recipes. Use it to generate Rails starter apps. Version 2.0 is out with a new Guide to the Rails Apps Composer Gem. If you build Rails applications that use popular gems or add features such as authentication, you'll save time with the rails_apps_composer gem. Plus you'll benefit from the collaborative problem-solving of Rails developers who face the same challenges.
Rails Apps Composer is a gem with recipes to create Rails application templates you can use to generate Rails starter apps. I use it to create the app templates and example apps for the RailsApps project. It's become popular (over 500 watchers on GitHub). It's a lot like Michael Bleigh's RailsWizard or Dr. Nic Williams's App Scrolls. If you've used the gem, you can take a poll to let me know if it has been useful and suggest any improvements you'd like to see. Here's the Roadmap for Rails Apps Composer 2.0.
I’ve released version 1.5.0 of the Rails Apps Composer gem (announcement here). It’s a gem you can use to generate a Rails starter app. Makes it easy to create and maintain a starter app from recipes that integrate commonly used gems. This release includes a cool new "defaults" feature contributed by Bryan Stearns. Rails Apps Composer is not the only fork of Michael Bleigh's RailsWizard gem; last month, Dr. Nic Williams of EngineYard forked the RailsWizard gem to create his App Scrolls gem. It seems there's renewed interest in the idea of generating starter apps for Rails. Probably because Rails continues to get more complicated and gems like these reduce the burden of integrating popular gems into a Rails app.
Just added to the RailsApps GitHub repo: an example app for Rails, Twitter Bootstrap, Devise, and CanCan. Twitter Bootstrap is coming on strong as a front-end framework to use with Rails; Devise continues to be popular for user management and authentication; and CanCan is a favorite for authorization architecture. This example app puts them together. Best of all, it comes with a detailed Rails Tutorial for Devise with CanCan and Twitter Bootstrap. The tutorial takes up where the popular RailsApps tutorial for Devise with RSpec and Cucumber leaves off. Like the other example apps in the RailsApps repo, this one comes with an application template to generate a starter app, with options for Haml, Devise modules, and more. Built with the Rails Apps Composer gem.
Haml and Rails
I've updated my guide to Haml and Rails with some helpful suggestions from Brook Riggio's blog post on Haml by Default in a New Rails 3.2 App. The RailsApps application templates now include a haml-html5 template offering you a choice of Haml or ERB, with options for a CSS front-end framework such as Twitter Bootstrap (Less or Sass), and a default application layout using HTML5 (see the article HTML5 Boilerplate for Rails Developers). It creates a simple starter app using Haml and HTML5.
Rails 3.2.2 has been released
Rails 3.2.2 has been released. This release contains various bug fixes and two important security fixes. The official announcement advises, "Users are recommended to upgrade as soon as possible." Here are detailed instructions for Installing Rails 3.2 with advice and tips.
Not such a big thing, but the rails3-devise-rspec-cucumber example app is popular and now it offers an option for including the Devise "Confirmable" and "Invitable" modules when you use the application template to create a starter app. Devise once included the "Confirmable" module by default; since it was removed there have been questions about how to set it up. The starter app does it for you and includes Cucumber tests as a bonus. It's all in an update to the rails_apps_composer gem that I use to build the application templates.
Ruby 1.9.3-p125 is released, the new recommended Ruby version, available via rvm.

Update Ruby with "rvm install ruby-1.9.3-p125" and also "gem update rake" to
Heroku offers Ruby 1.9.2 as a default with its newest stack. But did you know you can use Ruby 1.9.3 (Ruby's current recommended stable release)? Here's how to set up an app with Rails 3.2 and Ruby 1.9.3 on Heroku. See Deploying Rails 3.2 with Ruby 1.9.3 on Heroku.
Guide to Installing Rails 3.2
Detailed instructions (with advice) on how to install the latest release of Rails 3.2. See a Guide to Installing Rails 3.2.
Rails v3.2.1 has been released to provide minor fixes to the previous release. See the Ruby on Rails v3.2.1 Changelogs.
My RailsApps tutorials and starter apps have been well-received (thanks!) and today I completed a new one. You can find the example app for Rails 3.1 Subdomains in the GitHub repo. The Rails 3.1 Subdomains Tutorial is in the GitHib wiki and you can find an application template for a Rails starter app on GitHub as well. The example app shows how to build an app with "Basecamp-style" use of subdomains using Mongoid for a datastore and Devise for authentication. As always, please try it, copy, fork and submit issues so all may benefit.
It's easy to create a new Rails application using "rails new myapp". But after that, what do you do? What gems do you always add? What decisions do you make before beginning development? What important items are often overlooked before deploying an app? I'd like to put together a reference checklist to share. Any suggestions? I've asked on Stack Overflow: Checklist for starting a new Rails application?
I've just written a Guide to HTML5 Boilerplate for Rails Developers. HTML5 Boilerplate serves as a useful reference for Rails developers who want to provide structure and convention for the HTML, CSS, and Javascript of an application’s front-end. But not all of HTML5 Boilerplate is useful for a Rails developer. With this guide you can pick and choose the components that are useful for a Rails application.
Example Apps for Rails 3.1
Examples (with walk-through tutorials) for Rails 3.1 using Devise (authentication), OmniAuth (authentication), RSpec, Cucumber (BDD), Mongoid (NoSQL datastore). Useful as starter apps or reference implementations.

Rails 3.1 example apps
A Guide to Installing Rails 3.1
Detailed instructions on how to install Rails 3.1 with advice and troubleshooting tips:

A Guide to Installing Rails 3.1
Detailed (and current) instructions on how to install Rails 3.1. Suggests upgrading to RubyGems 1.8.5 and Rake 0.9.1 (and shows how). Points out a problem with "gem install rails --pre". With other surprises, advice, and troubleshooting tips.
Daniel Kehoe's detailed tutorial and example code for OmniAuth and Mongoid shows how to build a complete Rails 3 example app with OmniAuth and Mongoid. OmniAuth manages authentication using Twitter, Facebook, or many other service providers. MongoDB is used as a datastore with the Mongoid gem for quick development without schemas or migrations. This tutorial also gives you the option of using jQuery, Haml, RSpec and Cucumber, showing how to integrate each option. In addition to the tutorial, Kehoe provides a Rails application template you can use to generate a fully-functional starter app in minutes. Kehoe's previous tutorials and example apps have been popular (as can be seen by the number of watchers and forks on GitHub) and include starter apps for "Mongoid and Devise" and "Devise with Subdomains".
(with a detailed walk-through tutorial) that shows how to set up subdomains in Rails 3 using Devise for authentication:

Rails 3 Subdomains Devise

The tutorial goes into detail about the how to set up the app to maintain sessions across subdomains.
On GitHub: rails3 mongoid devise example app and tutorial. With an application template generator so anyone can use the example as a beginning point for a new Rails app. Options for Haml and Heroku.