Question

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?

Was it helpful?

Solution

Inside the scaffold config write:

conf.list.label = 'The list label'
conf.create.label = 'Let's make a new widget, shall we?'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top