Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Latest commit

 

History

History
54 lines (39 loc) · 892 Bytes

configurations.md

File metadata and controls

54 lines (39 loc) · 892 Bytes

Configurations

Setting

Theres a couple ways to set configuration values.

Option 1: Blocks

Guts.configure do |config|
  config.my_key = "some value"
end

You could also place this in your Rails application under config/initializers/guts.rb

Option 2

Guts.configuration.my_key = "my_value"

Getting

To grab a configuration value simply do Guts.configuration.{you_key}.

Default Configurations

These configurations can be overwritten.

config.file_image_sizing returns a list of sizes for Paperclip to use.

{
  thumb: "50x50",
  small: "100x100",
  compact: "160x160",
  medium: "240x240",
  large: "480x480",
  grande: "600x600",
  supreme: "1200x1200"
}

config.file_allowed_content_types returns a list of mime-types accepted by Paperclip.

[
  "image/jpg",
  "image/jpeg",
  "image/png",
  "image/gif"
]