开发者

How to Override Form Heading or Title in ActiveScaffold

Is there an easy way to override the title on an ActiveScaffold page? I know I can customize the name of the model part, but what if I want to say "Let's make a new widget, shall we?" instead of "Create Widget"? It seems overkill to override the whole template or partial just to get a new heading.

The ActiveScaffold default _create_form_html.erb is

开发者_运维知识库  <% form_action ||= :create %>
  <%= render :partial => "base_form", :locals => {:xhr => xhr ||= nil,
      :form_action => form_action,
      :method => method ||= :post,
      :cancel_link => cancel_link ||= true,
              :headline => headline ||= active_scaffold_config.... } %>

Is there a way to set that headline variable from inside the controller?


Inside the scaffold config write:

conf.list.label = 'The list label'
conf.create.label = 'Let's make a new widget, shall we?'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜