Installation
gem install rmagick # you'll need ImageMagick & Ruby first
gem install colormath
gem install micro-optparse
# Capistrano configuration | |
# | |
# require 'new_relic/recipes' - Newrelic notification about deployment | |
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
# set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
# set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP |
# -*- encoding : utf-8 -*- | |
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb) | |
namespace :deploy do | |
namespace :assets do | |
desc <<-DESC | |
Run the asset precompilation rake task. You can specify the full path \ | |
to the rake executable by setting the rake variable. You can also \ |
<form action="<%= @pay_desc['mrh_url'] %>" method="post"> | |
<input type=hidden name=MrchLogin value="<%= @pay_desc['mrh_login'] %>"> | |
<input type=hidden name=OutSum value="<%= @pay_desc['out_summ'] %>"> | |
<input type=hidden name=InvId value="<%= @pay_desc['inv_id'] %>"> | |
<input type=hidden name=Desc value="<%= @pay_desc['inv_desc'] %>"> | |
<input type=hidden name=SignatureValue value="<%= @pay_desc['crc'] %>"> | |
<input type=hidden name=Shp_item value="<%= @pay_desc['shp_item'] %>"> | |
<input type=hidden name=IncCurrLabel value="<%= @pay_desc['in_curr'] %>"> | |
<input type=hidden name=Culture value="<%= @pay_desc['culture'] %>"> | |
<input type=submit value='Оплатить'> |
after_save :destroy_original | |
private | |
def destroy_original | |
File.unlink(self.photo.path) | |
end |
<!DOCTYPE html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset='utf-8'> | |
ru: | |
activerecord: | |
errors: | |
messages: | |
taken: "%{model} с таким именем уже существует" | |
record_invalid: "Валидация не прошла: %{errors}" | |
restrict_dependent_destroy: | |
one: "Невозможно удалить запись, так как существуют зависимости: %{record}" | |
many: "Невозможно удалить записи, так как существуют зависимости: %{record} " | |
inclusion: "недопустимое значение" |
Note that this validation runs both after the file is uploaded and after CarrierWave has processed the image. If your base uploader includes a filter to resize the image then the validation will be run against the resized image, not the original one that was uploaded. If this causes a problem for you, then you should avoid using a resizing filter on the base uploader and put any specific size requirements in a version instead.
So instead of this:
require 'carrierwave/processing/mini_magick'
upstream backend { | |
server 127.0.0.1:3000 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name mydomain.com; | |
root /path/to/project/public; |
# app/controllers/custom_devise/password_controller.rb | |
class CustomDevise::PasswordsController < Devise::PasswordsController | |
def resource_params | |
params.require(resource_name).permit(:email, :password, :password_confirmation) | |
end | |
private :resource_params | |
end |