Rails themes can remember things

Posted by Dr Nic on October 07, 2009 and blessed with 1 comment

I was getting annoyed at having to remember all the csspath/xpath expressions for a theme I reused in a new project.

So, install_theme now helps each theme folder remember the previously used settings.

gem install install_theme  # version 0.7.0+
install_theme path/to/rails_app path/to/template #content_box \
      --partial "header:#header h2" \
      --partial sidebar:#sidebar"

Now, the next time you apply that same theme to another project you don’t need to mention “#content_box” or use the --partial flags:

install_theme path/to/another_rails_app path/to/template

How?

If you squint your eyes just right, you’ll notice that your original template folder now has an install_theme.yml file. It contains your original settings. You can imagine for yourself how the rest of the “themes can remember things” magic might work.

Templates “For Ruby on Rails”

If you are a template maker, you can now easily make your HTML template “For Ruby on Rails” by including an install_theme.yml file. Think of the children.

Major change

I changed the order of the first two arguments. In future, the path/to/template will be optional. Why? Imagine if each theme you ever used was cached in ~/.install_theme/themes and you could select a theme from a list or by --theme theme_name. That seems neat.

Related posts:

  1. First look at rails 3.0.pre This article is out of date in some aspects....
  2. Install any HTML theme/template into your Rails app Have you ever even bothered to Google for “rails...
  3. Closing in on The Dream: “one-click-to-deploy Rails apps” Got a simple app you want to build? Allocate...
  4. Need Rails Developers? Hire Australians There’s been some malarky very recently about “how do...
  5. One-stop JavaScript Unit Testing for Rails 2.0 Previously, I mentioned a multi-step/multi-project solution to doing JavaScript Unit...
Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. [...] This post was mentioned on Twitter by Ruby Reflector. Ruby Reflector said: Top Ruby Article: Rails themes can remember things: install_theme path/to/another_rails_app pa.. http://bit.ly/4oHzAJ [...]

Comments