A. D.'s Library tagged → View Popular
14 Jul 09
Developing iPhone applications using Ruby on Rails and Eclipse, Part 3: Developing advanced views for iPhone
-
Apple recommends that clickable targets be at least 44 pixels square for best usability.
Developing iPhone applications using Ruby on Rails and Eclipse, Part 2: Displaying iPhone content to the client
-
- The screen size of the iPhone (320x480) is much smaller than even the smallest target
application for a desktop Web application. The iPhone screen also has a significantly
different aspect ratio from a typical desktop or laptop monitor. - The pixel density of an iPhone is much greater than a desktop
monitor, allowing small text to be read somewhat more easily and somewhat changing the relative size of images. - Users can rotate the Mobile Safari view 90 degrees, changing the size and, more importantly, the aspect ratio of the screen.
- The touch-screen interface to Mobile Safari is less precise than a mouse interface,
meaning that targets like buttons and links should be larger and farther apart than would be necessary in a desktop application. - An iPhone is often used under slow network conditions. However, users have a strong expectation that the responses to their actions will be nearly instant.
The most important differences are:
- The screen size of the iPhone (320x480) is much smaller than even the smallest target
-
- Add your own CSS and JavaScript to your site based on Apple's sample code or other good-looking sites.
- Use a pre-existing toolkit.
There are two primary options for giving your Web application an iPhone look and feel:
- 1 more annotations...
Developing iPhone applications using Ruby on Rails and Eclipse, Part 1: Serving content for iPhones
-
- Detecting when a user accesses the site using an iPhone or an iPod touch.
- Allowing the user to freely switch between the mobile and regular versions of the site.
- Using a different layout for Mobile Safari users, including separate Cascading
Style Sheets (CSS) files and, possibly, JavaScript libraries. - Serving different content to mobile users.
To serve your mobile users, your Rails application needs to manage the
following:
-
Helvetica is the font of choice for iPhone system links. The font size is a little
smaller than recommended for body text, but this isn't supposed to be body text. The
other items will center the link in the viewport. The result looks like Figure 5
17 Sep 08
真实世界中的 Rails,第 4 部分: Ruby on Rails 中的测试策略
-
很多开发人员对 stub 和 mock 这两个概念都不是很清楚,很容易混淆。stub 即是用更简单的实现代替真实世界中的实现。在清单 4 中的这个 stub 就用一个简单的替代物代替了我们的整个登录系统。stub 的作用就是模拟真实世界。mock 则不同,mock 对象更像一个测量工具,可以测量应用程序使用接口的方式。我在本文后面的部分将会更详细地讨论 stub 并会给出一些示例。
-
如果说 stub 提供了一个简化的真实世界模拟,那么 mock 可以做更多。有时,简单的模拟真实世界还不够。在测试时,需要确保代码能正确使用 API。例如,您可能会想要验证本地数据库应用程序是否打开了连接、执行了查询,并随后关闭了此连接。您也会想要验证控制器是否在一个模型对象上实际调用了
save。所以,mock 对象必须建立预期和行为。
Rails 有至少有 3 个 mock 库可用:Mocha、FlexMock 和 RSpec。
- 2 more annotations...
Selected Tags
Related Tags
Top Contributors
Groups interested in rails
Related Lists on Diigo
-
ror-project
Items: 1 | Visits: 104
Created by: A. D.
-
Rails ActiveMessaging Intro
message plugin for rails
Items: 11 | Visits: 227
Created by: Vincent Tsao
-
Rails Plugins
Items: 4 | Visits: 67
Created by: Vincent Tsao
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
