如何让 padrino-admin 页面生成器生成漂亮的自定义页面?
默认情况下,padrino-admin 会生成非常丑陋的管理页面,完全无法维护:
.group
=f.label :title
=f.error_message_on :title
=f.text_field :title, :class => :text_field
%span.description Ex: a simple text
.group
=f.label :name
=f.error_message_on :name
=f.text_field :name, :class => :text_field
%span.description Ex: a simple text
--- more annoyingly redundant frak
.group.navform.wat-cf
=f.submit pat(:save), :class => :button
=f.submit pat(:cancel), :onclick => "window.location='#{url(:pages, :index)}';return false", :class => :button
我写了一个很好的AdminFormBuilder < AbstractFormBuilder
,将它连接起来set :default_builder, 'AdminFormBuilder'
,它从非常短的代码生成相同的管理页面:
= f.inputs :name, :surname, :email
= f.inputs :password, :password_confirmation, :as => :password
= f.input :role, :as => :select, :options => access_control.roles, :descr => 'a simple text'
= f.submits
现在我想padrino g admin_page
生成更多这样的页面。我该怎么办?