require "rich" if Object.const_defined?("Rich") Rich.setup do |config| # == CKEditor configuration # # Rich ships with what I hope are sensible defaults. # You may want to override these. This is how. # # For example, the elements available in the formats # dropdown are defined like this: # config.editor[:formats] = "" # # By default, Rich visualizes what type of element # you are editing. To disable this: # config.editor[:startupOutlineBlocks] = false # == Image styles # # Rich uses paperclip for image processing. You can # define the styles you would like to use here. You # can use the standard syntax allowed by paperclip. # See: https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation # # When you change these after uploading some files, # remember to do let Paperclip re-generate these by running # rake paperclip:refresh CLASS=Rich::RichImage config.image_styles = { :thumb => "100x100#" } # == Allowed styles (in file manager) # # Of the styles specified above, which should be user # selectable in the file manager? # # Example: # config.allowed_styles = [ :large, :thumb ] # # Default: # config.allowed_styles = :all # == Default Style # # The style to insert by default. In addition to the # styles defined above you can also use :original to get # the unprocessed file. Make sure this style exists. config.default_style = :thumb # == User Authentication # # When defined, Rich will automatically call this method # in a before filter to ensure that the user is logged in. # # If you do not change this value from the default, anyone # will be able to see your images, and upload files. # # Example for Devise with an AdminUser model: # config.authentication_method = :authenticate_admin_user! # # Default (NOT recommended in production environments): # config.authentication_method = :none end Rich.insert end