lib/generators/ab_admin/model/templates/resource.erb in ab_admin-0.2.3 vs lib/generators/ab_admin/model/templates/resource.erb in ab_admin-0.3.0
- old
+ new
@@ -1,13 +1,13 @@
class AbAdmin<%= model.name %> < AbAdmin::AbstractResource
<% if model.respond_to?(:acts_as_nested_set_options) -%>
- settings :index_view => 'tree', :search => false, :batch => false, :well => false
+ settings index_view: 'tree', search: false, batch: false, well: false
<% else -%>
table do
<% index_attrs.without('id', 'updated_at').each do |attr| -%>
- field :<%= attr -%><%= ', :sortable => false' if translated_columns.include?(attr) %>
+ field :<%= attr -%><%= ', sortable: false' if translated_columns.include?(attr) %>
<% end -%>
end
search do
<% index_attrs.each do |attr| -%>
@@ -17,25 +17,25 @@
<% end -%>
form do
group :base do
<% index_attrs.without('id', 'created_at', 'updated_at', 'lat', 'lon', 'zoom', 'lft', 'rgt', 'depth').without(*translated_columns).each do |attr| -%>
- field :<%= attr -%><%= ', :sortable => false' if translated_columns.include?(attr) %>
+ field :<%= attr %>
<% end -%>
end
<% unless translated_columns.empty? -%>
locale_tabs do
<% translated_columns.each do |attr| -%>
- field :<%= attr -%><%= ', :as => :editor' if attr =~ /description|content|body/ %>
+ field :<%= attr -%><%= ', as: :editor' if attr =~ /description|content|body/ %>
<% end -%>
end
<% end -%>
<% asset_assocs = model.reflect_on_all_associations.find_all { |a| a.options[:as] == :assetable } -%>
<% asset_assocs.each do |a| -%>
- field :<%= a.name %>, :as => :uploader
+ field :<%= a.name %>, as: :uploader
<% end -%>
<% if (%w(lat lon zoom) - index_attrs).empty? -%>
- field :map, :as => :map
+ field :map, as: :map
<% end -%>
end
end
\ No newline at end of file