Tag: SimpleCaptcha
sudo port install ImageMagick
sudo yum install ImageMagick-devel
gem "galetahub-simple_captcha", :require => "simple_captcha"
bundle install --path vendor/bundle
bundle exec rails generate simple_captcha bundle exec rake db:migrate bundle exec rake db:migrate RAILS_ENV=production # 必要な場合
ApplicationController < ActionController::Base include SimpleCaptcha::ControllerHelpers end
<%= show_simple_captcha %>
if simple_captcha_valid? do this else do that end
SimpleCaptcha.setup do |sc| sc.image_magick_path = '/opt/local/bin' # you can check this from console by running: which convert end
<policymap> <!-- <policy domain="system" name="precision" value="6"/> --> <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> --> <!-- <policy domain="resource" name="memory" value="2GiB"/> --> <!-- <policy domain="resource" name="map" value="4GiB"/> --> <!-- <policy domain="resource" name="area" value="1gb"/> --> <!-- <policy domain="resource" name="disk" value="16eb"/> --> <!-- <policy domain="resource" name="file" value="768"/> --> <!-- <policy domain="resource" name="thread" value="4"/> --> <!-- <policy domain="resource" name="throttle" value="0"/> --> <!-- <policy domain="resource" name="time" value="3600"/> --> <policy domain="coder" rights="none" pattern="EPHEMERAL" /> <policy domain="coder" rights="none" pattern="HTTPS" /> <policy domain="coder" rights="none" pattern="HTTP" /> <policy domain="coder" rights="none" pattern="URL" /> <policy domain="coder" rights="none" pattern="FTP" /> <policy domain="coder" rights="none" pattern="MVG" /> <policy domain="coder" rights="none" pattern="MSL" /> <policy domain="coder" rights="none" pattern="TEXT" /> <!-- <policy domain="coder" rights="none" pattern="LABEL" /> --> <policy domain="path" rights="none" pattern="@*" /> <policy domain="coder" rights="read | write" pattern="JPEG" /> <policy domain="coder" rights="read | write" pattern="PNG" /> </policymap>
ja: simple_captcha: placeholder: "Enter the word" label: "画像の文字を入力してください"