You can use Rails Composer, “the Rails generator on steroids,” to create any of the Rails 4.1 example applications from the RailsApps project. In minutes you get a starter app, ready to customize and deploy.
Here’s the newest starter app you get with Rails Composer:
Devise is for authentication and user management. You might not know Pundit. It’s a great new gem for authorization and access control, simpler than CanCan and easier to use with Rails 4.1. Together with options for Bootstrap or Foundation, you get a powerful starter app in minutes with Rails Composer.
Make sure you have Rails 4.1.0 installed and run:
$ rails new myapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
You’ll get a menu of starter apps. Choose options for ERB or Haml or Slim, different databases, and Bootstrap or Foundation front-end frameworks.
Here’s the complete list of starter apps that Rails Composer will generate for Rails 4.1:
Development of the Rails Composer tool is supported by the RailsApps project. If you like the tool, please accept our invitation to join the project as a subscriber.
I’ve launched Quickstart Guides, a new format for RailsApps publications.
These Quickstart Guides are available only for RailsApps subscribers. If you haven’t yet, please join the RailsApps project so I can continue to release example applications and new guides and tutorials.
Today two new guides are available:
Everyone loves the in-depth RailsApps tutorials but I’ve wanted to create a series of shorter guides that help experienced developers get started quickly. These new guides are an experiment; please let me know if you like the new format and I’ll continue with more topics, including guides based on the new example applications for Devise, OmniAuth, and Devise and Pundit.
Rails 4.1.0.rc1 is out and I’ve released new example applications for Rails 4.1:
I’ve also updated earlier example applications for Rails 4.1:
With Rails 4.1, I’ve dropped the Figaro gem and am using the new app/config/secrets.yml file to manage configuration variables such as login credentials or API keys.
I’ve released a new version of the rails_layout gem that sets up appropriate navigation links for OmniAuth (sign in and sign out). OmniAuth is a popular gem for authentication.
The rails_layout gem already generates navigation links for Devise. But I wanted to support OmniAuth as an alternative to Devise for authentication.
The goal is to improve support for OmniAuth in the Rails Composer tool. I’m releasing that today, too.
I’ve released version 1.19 of the book Learn Ruby on Rails.
The new version shows how to set up the Foundation 5.0.3 front-end framework. Foundation 5 has been out since November but versions 5.0.1 and 5.0.2 were incompatible with the Rails asset pipeline and Turbolinks. Foundation 5.0.3 is compatible, so I show how to use it in the book.
I’ve rewritten several chapters based on suggestions from technical editors. The revisions improve clarity; the tutorial application is the same.
Rails 4.1.0.beta1 was released December 18, 2013. I expect the next version of the book will cover Rails 4.1. The Figaro gem will be dropped, along with the config/application.yml file, which will be replaced with a config/secrets.yml file.
Right now, the book is available only to people who have purchased subscriptions to the RailsApps project. You can read it online or download the book in three ebook formats: PDF, Mobi (Kindle), ePUB (iBooks). A subscription is $19/month and gives you access to updates, including the forthcoming update for Rails 4.1.
You can order the book on the website for Learn Ruby on Rails.
People who contributed to the Kickstarter campaign for the book can also download the newest version of the book.
Today I released the rails_layout gem version 1.0.1. The gem is getting frequent use and I’m getting significant and useful code contributions.
I built the gem so I could easily generate application layout files for a choice of front-end frameworks, including Foundation and Bootstrap. The gem is a key component to the Rails Composer tool, which generates starter apps. You get a choice of front-end frameworks to bake into your starter apps.
I’m working on a new example application for Rails and Devise. The Rails 3.2 example applications that use Devise have been popular starter apps. The new rails-devise example application is even better. Of course it is updated for Rails 4.0, but it also offers a choice of Foundation or Bootstrap, for a more attractive starter app.
Devise can generate view files for login and signup pages (also “edit account” and “forgot password” pages) but the pages are not attractive. The new starter app uses the rails_layout gem to generate attractive view files for Devise that contain CSS styling for Foundation or Bootstrap. Here’s a screenshot of a login page, using Foundation.
The idea of a starter app is to save time for developers. Everyone needs a basic application that uses Devise, with a favorite front-end framework. Why build it from scratch? And why tweak the Devise view files every time? Let’s go open source with a starter app.
In releasing version 1.0.1 of the rails_layout gem, I’ve changed its API and its commands to accommodate the new feature that generates Devise views.
The rails-devise example application is still a work in progress but you can try it out. Just build it with the Rails Composer tool.
You can also use the rails_layout gem on its own.
As always, a big shout of thanks to the developers who support the RailsApps project with monthly subscriptions.
I love to talk to entrepreneurs who’ve launched their ideas using applications or tools from RailsApps. I recently heard from Chris Armstrong, founder of CrowdOutfit. Here’s an interview about his experience building the CrowdOutfit site.
What is CrowdOutfit?
CrowdOutfit is a community of fashionistas that track down clothes you see online and love, but can’t find where to buy in your price range. Post a pic and we track it down or re-create the look for less.
Many people admire favorite styles from Pinterest pins and blog posts. But way too often, when they want to buy the clothes they get the dreaded ‘out of stock’ page, or worse yet, no trace of where it came from! Even if they can find the item (after hours of searching) a lot of it is way out of the price range of your average person. Looks pretty, but no thanks to that $2,500 jacket…
Our community solves this problem. We track down what you want in your price range. You show us what you want (or follow someone else’s request) and a community of personal shoppers find it for you.
Are you a solo developer?
The team is me, myself and I. I’ve been the designer, full-stack developer and now full-stack marketer of the project. This has been great from a learning experience and full-control perspective, but obviously makes time my biggest enemy.
What’s your skill level in Rails?
My skill level is Intermediate. I have a background in information systems from an analyst/project management side and have done some coding in the past. However, I was new to Ruby and Rails when I came upon RailsApps.
How was the RailsApps project helpful?
Too many tutorials focus on using Rails scaffolding to create a basic app. Intro tutorials can show off the power of Rails, but don’t help with a realistic production-ready app. RailsApps gave something much better, a starting point project that included the basics anyone would need, including powerful gems that don’t re-invent the wheel. This allowed me to look through and see how things were set up. RailsApps modeled good practices in the way it set up layouts, development/testing/production configuration, and overall good config and YAML files (e.g. keeping environment variables private for your SMTP or API key credentials).
I was quickly able to customize what I wanted. Whenever I wanted to add a feature, there was a good working reference of where to plug in things. Then, as my knowledge grew it was easier to make more sweeping changes.
Which example app did you use?
I used the Twitter Bootstrap, Devise, CanCan example app. It’s a great starting point for any site with user accounts and lets you tap into the power of Bootstrap for design. Most web apps depend on the basics provided in this app.
What modifications did you make to the app?
The benefit to a starter app is it can be used by nearly any site and then you can add what you need. I made numerous modifications (mostly enhancements) that ended up being specific to the visual-Q/A community-driven site I was building.
Some of the modifications I made include:
Before I integrated analytics at a deeper level, I was using RailsAdmin for a glance at who the newest users were and whether they returned to the app (super important to monitor for engagement).
What’s the biggest challenge you’re facing now?
The biggest challenge is on the marketing side. I was in complete coding and dev mode before. Now, with an app out in the wild, the key is bringing in traffic and getting people engaged with the product and using it on a regular basis.
The most important thing is to focus on measuring what people are doing in the app, what makes them come back, and what’s a roadblock keeping them from being more engaged. Users need to get value out of their experience (and quickly). The more I can focus on good lifecycle e-mail marketing, a better initial walk-through experience, reducing user friction to use the community features, making it easy to share the site, etc… the more the community will grow.
Programmers often over-focus on optimizing code, but marketing while you code is crucial to actually get people using what you’ve created…no matter how awesome it is!
I just want to say I’ve really appreciated your fantastic work on the RailsApps project. It’s a great marriage of clearly articulated writing/documentation and real, usable code (a rare combo).
I get a great deal of satisfaction from writing and updating articles for Rails developers. All of the articles are hosted on the site railsapps.github.io.
I’ve written articles about integrating front-end frameworks with Rails, including the articles Rails and Bootstrap and Rails and Foundation. But until today, the layout for the articles used an old version of Bootstrap. Today I updated the layout for the articles to use the newest version of Foundation, providing a responsive web design, which means the articles are easy to read on a tablet or mobile device.
I also recently updated the home page for railsapps.github.io. When I launched the site in May 2011, the home page was just an index of links to a few example applications and tutorials. Now the home page is a real landing page that describes the full scope of the RailsApps project. I’ve added a call to action to encourage people to sign up to support the project.
A big thanks to Joel Dezenzio for encouraging me to update the layout and getting the process started..
I’ve released version 1.17 of the book Learn Ruby on Rails. The book is available online with a monthly subscription to the RailsApps project (plus Kickstarter contributors continue to get updates). This week I’ve also released an updated Rails and Bootstrap tutorial (see a blog post for details), covering Rails 4.0 and Bootstrap 3.0. It is a good follow-on tutorial for people who finish the Learn Ruby on Rails book and want to expand their knowledge of Rails. Here’s the link if you want to subscribe to get the combination of the book and the RailsApps tutorial:
The book now covers Rails version 4.0.2, updated from version 4.0.1.
I’ve changed the Gemfile to remove
gem 'compass-rails', '~> 2.0.alpha.0' and replace it with
gem 'compass-rails', '~> 1.1.2'. The 2.0.alpha.0 version was yanked from the RubyGems server. The compass-rails gem is needed for Foundation 4.3. It will not be needed for Foundation 5.0.
I’ve changed the Gemfile to replace
gem 'zurb-foundation' with
gem 'zurb-foundation', '~> 4.3.2'. Foundation 5.0 will require
gem 'foundation-rails' but we can’t use it until an incompatibility with Turbolinks is resolved. So we will stick with Foundation 4.3.2 for now.
I’ve revised code in the “Analytics” chapter and am using
ready page:change instead of
page:load to accommodate Turbolinks. I’ve updated the segmentio.js file to use a new tracking script from Segment.io and updated instructions for setting up Google Analytics tracking on Segment.io.
I’ve revised the “Getting Help” chapter and added a “Version Notes” chapter, which will be a regular feature of future updates.
There are several minor clarifications, plus fixes for various typos and insignificant errors.
Best of all, I’ve included the results of the “name the cat” contest in the “Credits and Comments” chapter.
I expect version 1.18 of Learn Ruby on Rails will contain major changes.
Rails 4.1.0.beta1 was released this week. The next version of the book will cover Rails 4.1. The Figaro gem will be dropped, along with the config/application.yml file, which will be replaced with a config/secrets.yml file.
Foundation 5.0 was released November 21, 2013. It is currently incompatible with Turbolinks. The next version of the book will cover Foundation 5.0, assuming the Turbolinks issue is resolved.
If you have a monthly subscription to the RailsApps tutorials, or you purchased an early edition of the book through the Kickstarter campaign, you’ll receive an email announcement when version 1.18 is released.
This is a roundup of resources and an announcement of updates from the RailsApps project for Rails and Bootstrap.
I don’t know about you, but I still call it Twitter Bootstrap. It’s now officially Bootstrap so I have to double check everything I write to make sure I’m not calling it Twitter Bootstrap. Anyway, it’s the most popular front-end framework and many people look for guidance to integrate it with Rails.
I introduce front-end frameworks to beginners in the book Learn Ruby on Rails. In the book, I show how to use Zurb Foundation, the second-most popular front-end framework. I don’t have a favorite of the two frameworks but I’ve noticed a slight preference among experienced Rails developers for Foundation. That’s probably because Foundation natively uses the Sass pre-processor which is favored by Rails developers. Also, Zurb provides an officially-supported Rails gem for Foundation. Until now, Rails gems for Bootstrap haven’t been supported by the Bootstrap maintainers, which led to confusion about which gem should be used with Rails, and delays when Bootstrap 3.0 was released. Recently the Bootstrap maintainers selected the bootstrap-sass gem as the official version for future releases, so Bootstrap will continue to be popular among Rails developers.
As a companion to the book, I’ve updated the Rails and Bootstrap tutorial. I wrote it six months ago, for Bootstrap 2.3, and now the updated version covers Bootstrap 3.0. It’s one of the most popular RailsApps tutorials. It’s also a good follow-on tutorial for people who finish the Learn Ruby on Rails book and want to expand their knowledge of Rails and front-end frameworks.
The tutorial is based on the rails-bootstrap starter application, which is available as an open source application on GitHub. You can easily generate the rails-bootstrap starter application with the Rails Composer tool. Which means, if you want to build a new Rails application with Bootstrap, you’ll have a basic application in about two minutes, ready to customize.
The key points of integration for Rails and Bootstrap are:
The rails_layout gem is a key ingredient in the starter application. It sets up the application layout, flash messages, and navigation links for either Bootstrap or Foundation. I’ve written a Bootstrap and Rails article that is available for free. The article covers the key points of integration for experienced Rails developers who are looking for a shorter guide to integrating Bootstrap and Rails, showing how to use the rails_layout gem to set up a Rails application.
The Rails and Bootstrap tutorial goes beyond the starter application and free article. It introduces the Bootstrap grid system and components. A walk-through shows how to set up a carousel to display images, showing how Bootstrap components are used in a Rails view. It also shows how to use form helpers with Bootstrap, using a survey form for an example. And it shows how to use modal windows, which are often used with forms in Rails. There are many tutorials that cover the full range of Bootstrap components but almost all are written without considering integration with Rails. I don’t cover all of Bootstrap, just enough so the reader will be comfortable working with Bootstrap and Rails and ready to explore further.
All these resources exist because of the revenue the RailsApps project receives from monthly subscriptions. The goal is simple: make it easy for Rails developers to use Bootstrap or Foundation as a front-end framework. Support from subscribers funds development for the open source rails_layout gem and the Rails Composer tool for starter applications. The open source rails-bootstrap application serves as a reference implementation and example application, with development funded by subscribers. The free Bootstrap and Rails article serves experienced developers. People who want more explanation support the project by subscribing for access to the in-depth Rails and Bootstrap tutorial. Newcomers who need more background can read the book Learn Ruby on Rails, which was funded by a Kickstarter campaign and gets updated as part of the RailsApps project. On behalf of everyone who benefits from the RailsApps project, I’d like to thank the subscribers who provide financial support for the RailsApps project.
Here are links: