Skip to content

Commit

Permalink
Merge pull request #182 from scientist-softserv/i162-fix-permitted-pa…
Browse files Browse the repository at this point in the history
…rams

🐛 Fix unpermitted params
  • Loading branch information
kirkkwang authored Nov 17, 2023
2 parents 85e73f7 + 587b2e2 commit ddd0516
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/forms/hyrax/pdf_form_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ module PdfFormBehavior

self.terms += %i[show_pdf_viewer show_pdf_download_button]
self.hidden_terms = %i[show_pdf_viewer show_pdf_download_button]
# Not sure why this is needed but the form was not working without it
# it was getting a Unpermitted parameter error for these terms
permitted_params << %i[show_pdf_viewer show_pdf_download_button]
end

def hidden?(key)
hidden_terms.include? key.to_sym
end

class_methods do
# Not sure why this is needed but the form was no working without it
# it was getting an Unpermitted paratemter error for these terms
def permitted_params
super + %i[show_pdf_viewer show_pdf_download_button]
end
end
end
end

0 comments on commit ddd0516

Please sign in to comment.