Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Commit

Permalink
update admin controllers to use strong params
Browse files Browse the repository at this point in the history
  • Loading branch information
bretdavidson committed Nov 12, 2015
1 parent aec799e commit c366cb7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/lentil/admin/admin_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
filter :sign_in_count
filter :created_at

controller do
resources_configuration[:self][:instance_name] = 'admin_user'
end

form do |f|
f.inputs "Admin Details" do
f.input :email
Expand Down
4 changes: 4 additions & 0 deletions lib/lentil/admin/tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
ActiveAdmin.register Lentil::Tag do
actions :index, :create, :new

permit_params :name

config.batch_actions = false
config.sort_order = "name_asc"

Expand Down Expand Up @@ -31,6 +33,8 @@
end

controller do
resources_configuration[:self][:instance_name] = 'tag'

def scoped_collection
super.includes :taggings, :tagsets
end
Expand Down
7 changes: 6 additions & 1 deletion lib/lentil/admin/tagsets.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
if defined?(ActiveAdmin)
ActiveAdmin.register Lentil::Tagset do
permit_params :description, :title, :harvest, :tag_ids => []

config.batch_actions = false
config.sort_order = "title_asc"
Expand Down Expand Up @@ -39,11 +40,15 @@
end
end

controller do
resources_configuration[:self][:instance_name] = 'tagset'
end

form do |f|
f.inputs do
f.input :title
f.input :description
f.input :tags, :input_html => {:class => [:"chzn-select"]}, :collection => Lentil::Tag.all.sort_by(&:name)
f.input :tags
f.input :harvest do |harvest|
harvest.capitalize
end
Expand Down

0 comments on commit c366cb7

Please sign in to comment.