Advanced Rails - Building Industrial-Strength Web Apps in Record Time
Rails L10n | 265 Now, we need to modify the views to use theString#tmethod, so that the views can be translated. This can be a t ...
266 | Chapter 8: i18n and L10n TheLOCALEShash is a list mapping two-letter language codes to the actual locale namesthat Globali ...
Rails L10n | 267 >> Locale.set 'es-MX' >> pp ViewTranslation.find(:all, :conditions => ['text IS NULL AND languag ...
268 | Chapter 8: i18n and L10n As a final touch, we will add a language bar that enables the user to switch back and forth betwe ...
Further Reading | 269 Further Reading Sven Fuchs has a great write-up about Globalize on his blog (http://www.artweb-design. de/ ...
270 | Chapter 8: i18n and L10n Figure 8-9. Spanish translation: viewing a newly created person Figure 8-10. Spanish translation: ...
271 Chapter 9 CHAPTER 9 Incorporating and Extending Rails 9 The best way to predict the future is to invent it. —Alan Kay Ruby o ...
272 | Chapter 9: Incorporating and Extending Rails DataMapper The DataMapper library (http://www.datamapper.org/) is based on Ma ...
Replacing Rails Components | 273 DataMapper uses many of the same constructs as Rails. Start out by defining a model class that ...
274 | Chapter 9: Incorporating and Extending Rails Ambition is not an object-relational mapper (in fact, it requires ActiveRecor ...
Replacing Rails Components | 275 TheQueryobject has ato_hashand a (mostly functional)to_sqlmethod, which help debug the SQL quer ...
276 | Chapter 9: Incorporating and Extending Rails This approach leads to very readable code, but it has a couple of drawbacks: ...
Replacing Rails Components | 277 Then we can build the Glue and Og (and, optionally, Raw and Nitro) libraries into gems and inst ...
278 | Chapter 9: Incorporating and Extending Rails Og::Mixin.autoload :Orderable, 'og/model/orderable' # 4. Models must be loade ...
Replacing Rails Components | 279 (See Chapter 2 for a full explanation ofDependencies.) We load all the Ruby files inapp/models ...
280 | Chapter 9: Incorporating and Extending Rails To get a better idea of the queries being issued, it is helpful to redirect t ...
Replacing Rails Components | 281 Og has finder methods reminiscent of ActiveRecord’s, but with slightly different syntax: >&g ...
282 | Chapter 9: Incorporating and Extending Rails Alternative Template Engines The standard Rails template engine uses Ruby’s E ...
Replacing Rails Components | 283 Logical separation The inability to execute code in the views forces model- and controller-rela ...
284 | Chapter 9: Incorporating and Extending Rails Notice that we do not need to close anything. The HTML tags are all closed fo ...
«
9
10
11
12
13
14
15
16
17
18
»
Free download pdf