TODO: make gem for this
This was tested using Rails 3.2 and Rails 4.0 on Ruby 2.0.0.
-
Set the install directory for Bower components:
// .bowerrc
| # lib/liquid_i18n_rails.rb | |
| module LiquidI18nRails | |
| def t(string) | |
| I18n.t(string.to_sym) | |
| end | |
| end | |
| # config/initializers/liquid.rb | |
| require 'liquid_i18n_rails' | |
| Liquid::Template.register_filter LiquidI18nRails |
| # lib/liquid_i18n_rails.rb | |
| module LiquidI18nRails | |
| def t(string) | |
| I18n.t(string.to_sym) | |
| end | |
| end | |
| # config/initializers/liquid.rb | |
| require 'liquid_i18n_rails' | |
| Liquid::Template.register_filter LiquidI18nRails |
| #!/bin/sh | |
| # Some things taken from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Set the colours you can use | |
| black='\033[0;30m' | |
| white='\033[0;37m' | |
| red='\033[0;31m' | |
| green='\033[0;32m' |
By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.
| # http://download.savannah.gnu.org/releases/freetype/ から最新のfreetypeをダウンロード | |
| tar zxvf freetype-x.x.x | |
| cd freetype | |
| ./configure | |
| make | |
| sudo make install | |
| curl -O http://www.swfmill.org/releases/swfmill-0.3.2.tar.gz | |
| tar zxvf swfmill-0.3.2.tar.gz | |
| cd swfmill-0.3.2 |
| pt-BR: | |
| errors: | |
| messages: | |
| not_found: 'não encontrado' | |
| already_confirmed: 'já foi confirmado' | |
| not_locked: 'não foi bloqueado' | |
| not_saved: | |
| one: '1 erro impediu que %{resource} fosse gravado:' | |
| other: '%{count} erros impediram que %{resource} fosse gravado:' |