Never interpolate user input directly in a SQL statement.
Don't:
User.where("name = #{params[:search][:name]}")| <div id="admin_menu></div> | |
| <% content_for :body do %> | |
| <%= yield %> | |
| <% end %> | |
| <%= render :file => 'layouts/application' %> |
| # this include won't work for some reason: | |
| # include Capistrano::Git::DefaultStrategy | |
| module SubmoduleStrategy | |
| # check for a .git directory | |
| def test | |
| test! " [ -d #{repo_path}/.git ] " | |
| end |
| # Example usage: | |
| # timeplot User.all | |
| # timeplot User.all, bucket_size: day, field: :updated_at | |
| # | |
| # Arguments: | |
| # bucket_size: One of [:day, :month, :year]. Defaults to :month. | |
| # field: Timestamp field to plot against. Defaults to :created_at. | |
| class TimePlot | |
| BUCKET_SIZES = [:day, :month, :year] | |
| X_AXIS_MAX = 100 |