· 1 min read
Screencast: Brakeman
Downloads in verschiedenen Formaten:
Resourcen:
terminal
[bash] gem install brakeman rbenv rehash brakeman brakeman -o brakeman.html bundle update rails brakeman —rake [/bash]
config/application.rb
[ruby] config.active_record.whitelist_attributes = true [/ruby]
products_controller.rb
[ruby] def index direction = params[:direction] == “desc” ? “desc” : “asc” @products = Product.order(“name #{direction}”) end [/ruby]
sessions_controller.rb
[ruby] redirect_to redirect_url, only_path: true [/ruby]
models/user.rb
[ruby] validates_format_of :name, with: /Aw+z/ [/ruby]
Gemfile
[ruby] gem ‘brakeman’, group: :development [/ruby]