Tag Archives: rubyonrails
Posted in: Programming by Steve on October 20, 2010
UPDATE (5/16/2011) – As Declan points out, this is no longer the case. you can use the master of devise from github to get this functionality back.
I have been moving one of my sites to a rails application, and I am using the HAML view engine to make all my templates. I am also using Devise as my authentication gem. I am going to be doing some customizations of the views, however, by default, devise generates the views in ERB.
This is how to get the devise generator to use a HAML template instead of ERB.
Add the following to your GEMFILE:
gem 'haml' group :development do gem 'hpricot' gem 'ruby_parser' end
Then execute the following statements in a terminal/command window:
bundle install rails generate devise:views -e haml
This will create the views for devise in HAML.
Posted in: Programming by Steve on October 15, 2010
I recently purchased a site template from ThemeForest and I wanted to use it in a brand spankin’ new Rails 3 website. I immediately created the application and installed haml. I had heard so much about haml that I wanted to use it with this new site. The DOCTYPE that the template used was 1.0 Transitional:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
However, by default, Rails 3 and haml render the default DOCTYPE as HTML5, like this:
!!! # => renders as <!DOCTYPE html>
Unfortunately, even if you try to add “!!! Transitional” as documented, it will not render the correct DOCTYPE. So in order for me to get the correct doctype, I had to add a haml.rb configuration file under /config/initializers/ with the following code at the top of the file:
Haml::Template.options[:format] = :xhtml
Posted in: Programming by Steve on September 29, 2010
Getting constant feedback on the health of your system is always a great thing. In rails, you can install a gem called autotest that can run your tests as you change your application and let you know if you have broken anything.
All you have to do is start a terminal window, and type “autotest”. That’s it! You get instant feedback on your tests!
Posted in: Programming by Steve on September 13, 2010
I could go through each session and say what I learned, but I think going to these conferences should be more about the overall impression than about the nitty gritty details. I wanted to meet as many people as possible and take in as much information as I could.
I got to meet a lot of great people like Scott Parker, Andy Maleh, Rachel Heaton, and Nick Lewis. But the one thing I got from the conference is that the demand for Rails developers is growing, and growing fast. All of the companies that were there (Groupon, Obtiva, Hashrocket, etc..) were hiring new talent, which is pretty amazing considering the economy.
My thoughts are confirmed by this article by the San Francisco Chronicle.
Quote of the Day: “So, your corporate culture sounds great … for bachelors” – Sara Trice in response to Hashrocket presentation on Team Building
Word of the Day: “Rehacktoring” – Jake Scruggs
Interesting Note: Apple was a sponsor of the conference