For a simple application the erb files can be common for all devices, but for device-specific applications we can customize the views independently. Rhodes supports platform-specific loading of view (erb) files. At compile time, the application detects the current platform, and checks first for a platform-specific file before loading the default view file.
To create a platform-specific file, simply name the file using the following convention [action_name].[platform_abbreviation].erb
(e.g.index.bb.erb
, show.wm.erb
). It will work for all the files that are in the app and public folder. These are the different abbreviations for the different devices:
Device |
Abbreviation |
File name |
---|---|---|
Android |
Android |
|
Blackberry |
bb |
|
iPhone |
iphone |
|
Windows Mobile |
wm |
|
As an example, the BlackBerry browser has severely limited support for modern CSS. In order to take full advantage...