lib/generators/active_admin/resource/templates/admin.rb in activeadmin-1.0.0.pre2 vs lib/generators/active_admin/resource/templates/admin.rb in activeadmin-1.0.0.pre3
- old
+ new
@@ -1,17 +1,17 @@
ActiveAdmin.register <%= class_name %> do
-<% if Rails::VERSION::MAJOR == 4 || defined?(ActionController::StrongParameters) %>
+<% if ActiveAdmin::Dependency.rails.strong_parameters? %>
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
-# permitted << :other if resource.something?
+# permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted
# end
<% end %>
<% if options.include_boilerplate? %>
# Limit actions available to your users by adding them to the 'except' array
@@ -33,7 +33,13 @@
# show do |<%= class_name.downcase %>|
<%= @boilerplate.rows %>
# end
# Add or remove fields to toggle their visibility in the form
+# form do |f|
+# f.inputs do
+<%= @boilerplate.form_inputs %>
+# end
+# f.actions
+# end
<% end %>
end