Skip to content

Commit

Permalink
Add a comment to notice about security (#3318)
Browse files Browse the repository at this point in the history
  • Loading branch information
enderahmetyurt authored Oct 9, 2024
1 parent 49da691 commit 9a9a4b2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/generators/avo/tool_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ def #{file_name}
# bin/rails generate avo:tool lolo
# will generate the avo.lolo_path helper
# THe fact that it will always generate the definded? and Avo::Engine.routes.draw wraps is unfortunate. We'd love a PR to fix that.
route_contents = <<-ROUTE
if defined? ::Avo
Avo::Engine.routes.draw do
get "#{file_name}", to: "tools##{file_name}", as: :#{file_name}
end
end
route_contents = <<~ROUTE
if defined? ::Avo
Avo::Engine.routes.draw do
# This route is not protected, secure it with authentication if needed.
get "#{file_name}", to: "tools##{file_name}", as: :#{file_name}
end
end
ROUTE
append_to_file "config/routes.rb", route_contents

Expand Down

0 comments on commit 9a9a4b2

Please sign in to comment.