This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveAdmin.register User do | |
permit_params :email, :name, :paid, :user_id, :first_ip, :current_sign_in_ip, :password | |
member_action :reset_ip, method: :put do | |
resource.first_ip = resource.current_sign_in_ip | |
resource.save! | |
redirect_to resource_path, notice: "IP сброшен!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::RegistrationsController < Devise::RegistrationsController | |
# before_action :configure_sign_up_params, only: [:create] | |
# before_action :configure_account_update_params, only: [:update] | |
# GET /resource/sign_up | |
# def new | |
# super | |
# end | |
# POST /resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="wistia_<%= @task.video %>"> | |
<% if @task.video.length > 10 %> | |
<iframe width="640" height="360" src="<%= @task.video %>" frameborder="0" allowfullscreen></iframe> | |
<% else %> | |
<iframe src="https://player.vimeo.com/video/<%= @task.video %>" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen> | |
<div class=""> | |
<%= current_user.email %> | |
</div> | |
</iframe> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add signs to videos | |
* Фрейм с видео должен содержать класс "video--signed" и находиться в блоке контейнера ```<div class="video-container">```. При добавлении видео необходимо указать атрибут фрейма ```fs="0"```, чтобы не срабатывал полноэкранный режим фрейма. | |
* Параметры прописываются в виде data-* атрибутов фрейма с видео. | |
* Параметры: | |
* - data-sign-opacity - прозрачность от 0 до 1 | |
* - data-sign-color - цвет в любом формате CSS | |
* - data-sign-font-size - размер шрифта | |
* - data-sign-text - текст | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This file configures the New Relic Agent. New Relic monitors Ruby, Java, | |
# .NET, PHP, Python and Node applications with deep visibility and low | |
# overhead. For more information, visit www.newrelic.com. | |
# | |
# Generated August 17, 2017, for version 4.3.0.335 | |
# | |
# For full documentation of agent configuration options, please refer to | |
# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#То как все выглядит сейчас | |
ActiveAdmin.register PaidProject do | |
permit_params :user_id, :project_id | |
show do |t| | |
attributes_table do | |
row :user do | |
paid_project.user.name | |
end | |
row :project do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var platformLanguage = navigator && ( | |
navigator.language || | |
navigator.browserLanguage || | |
navigator.systemLanguage || | |
navigator.userLanguage || | |
null ), | |
elemsRU, elemsUK, elemsKZ, elemsEN; | |
if (platformLanguage.match("ru") && document.getElementsByClassName) { | |
elemsRU = document.getElementsByClassName("b-text_lang_ru"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ApplicationRecord | |
# Include default devise modules. Others available are: | |
# :confirmable, :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable, | |
:confirmable, :omniauthable | |
validates :fullname, presence: true, length: {maximum: 50} | |
def self.from_omniauth(auth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
def facebook | |
# You need to implement the method below in your model (e.g. app/models/user.rb) | |
@user = User.from_omniauth(request.env["omniauth.auth"]) | |
if @user.persisted? | |
sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated | |
set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format? | |
else | |
session["devise.facebook_data"] = request.env["omniauth.auth"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PostgreSQL. Versions 9.1 and up are supported. | |
# | |
# Install the pg driver: | |
# gem install pg | |
# On OS X with Homebrew: | |
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config | |
# On OS X with MacPorts: | |
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
# On Windows: | |
# gem install pg |