Skip to content

Instantly share code, notes, and snippets.

View AlekseyPn's full-sized avatar
👨‍💻
Not time to rest

_fargustian AlekseyPn

👨‍💻
Not time to rest
  • Berlin
View GitHub Profile
@AlekseyPn
AlekseyPn / application_controller.rb
Created September 15, 2018 16:03 — forked from AhmedNadar/application_controller.rb
How to redirect to a 404 in Rails?
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
def not_found
raise ActionController::RoutingError.new('Not Found')
rescue
render_404
end
@AlekseyPn
AlekseyPn / customize_error.rb
Created May 22, 2018 17:19 — forked from telwell/customize_error.rb
Customize Field Errors with Rails 5 and Bootstrap
# Adapted from https://rubyplus.com/articles/3401-Customize-Field-Error-in-Rails-5
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = ''
form_fields = [
'textarea',
'input',
'select'
]
1. Добавить в дефолтную конфигурацию, в before launch external tools
2. Настроить в нем make start команду
@AlekseyPn
AlekseyPn / cloudSettings
Last active August 13, 2018 09:27
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-08-13T09:27:54.355Z","extensionVersion":"v3.0.0"}
Как использовать Pixel Glass в своём проекте?
1. Установите пакет в папку с проектом через npm:
npm i pixel-glass --save-dev
2. Поместите макеты страниц в ваш проект в папку img (или в другую, какая вам нравится).
3. Добавьте этот код на вашу страницу в элемент <head>:
<!-- Pixel Glass -->