小编akf*_*con的帖子

Rails 3 - 设置页面标题的理想方式

什么是在rails 3中设置页面标题的正确方法.目前我正在做以下事情:

应用程序/视图/布局/ application.html:

<head>
  <title><%= render_title %></title>
  <%= csrf_meta_tag %>
Run Code Online (Sandbox Code Playgroud)

应用程序/佣工/ application_helper.rb:

def render_title
  return @title if defined?(@title)
  "Generic Page Title"
end
Run Code Online (Sandbox Code Playgroud)

应用程序/控制器/ some_controller.rb:

def show
  @title = "some custom page title"
end
Run Code Online (Sandbox Code Playgroud)

有没有其他/更好的方法来做上述事情?

ruby-on-rails-3

71
推荐指数
3
解决办法
4万
查看次数

iPhone上的Instagram图像过滤器

如何在iPhone应用程序中添加图像过滤器?(类似于Instagram和picplz所拥有的)

iphone objective-c

45
推荐指数
3
解决办法
4万
查看次数

标签 统计

iphone ×1

objective-c ×1

ruby-on-rails-3 ×1