Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a comment to notice about security #3318

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading