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 Image < AR::Base | |
validates :src, presence: true | |
validate :set_status_to_missing_url, :if => lambda { src.blank? } | |
def process | |
@logo_image = RmagickHelper.new self.src | |
rescue Magick::ImageMagickError => ex | |
logger.error "ImageMagick can not process the image: #{ex.message}" | |
ex.backtrace.each { |line| logger.debug line } | |
@logo_status = 'cant_process' |
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 EnrollmentController < ApplicationController | |
def new | |
@users_assignments = [] | |
3.times{ @users_assignments << @event.assignments.build } | |
end | |
def create | |
@event = Event.new params[:event] | |
@event. | |
redirect_to 'new' and return unless @event.save |
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
def print_example | |
@print = Pdf::TicketDetail.find(params[:id]) | |
drop = TicketDrop.new(@ticket) | |
drop.generate_ticket TicketAttrs.for(session) | |
@output = Liquid::Template.parse(@print.body).render('pdf_ticket_details' => drop).html_safe | |
render layout: false | |
end | |
def create_example | |
@ticket = Pdf::Ticket.find(params[:id]) |
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
cookbook_path 'cookbooks' | |
node_path '../chef-repo/nodes' | |
role_path '../chef-repo/roles' | |
environment_path '../chef-repo/environments' | |
data_bag_path '../chef-repo/data_bags' | |
#encrypted_data_bag_secret 'data_bag_key' | |
knife[:berkshelf_path] = 'cookbooks' |
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 AdminTemplatesController < ApplicationController | |
def new | |
@admin_template = AdminTemplate.new | |
render 'admin/templates/form', layout: (not request.xhr?) | |
end | |
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
{ | |
:user_hash => Proc.new { |current_user| | |
OpenSSL::HMAC.hexdigest("sha256", "ENV['intercom_secret']", current_user.id.to_s) | |
} | |
} |
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 class="row"> | |
<div class="wide-block contact-form" id="message_form"> | |
<!-- url: 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', method: :post--> | |
<div id="spinner" class="spinner" style="display:none;"> | |
<%= image_tag('ajax-loader.gif') %> | |
</div> | |
<%= form_for(@message ||= Alchemy::Message.new, :remote => true) do |form| %> | |
<%= form.hidden_field :contact_form_id, :value => element.id %> | |
<%#= form.hidden_field :oid, :value => '00D20000000DB0V'%> |
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 Group < ActiveRecord::Base | |
has_many :memberships | |
has_many :users, :through => :memberships | |
belongs_to :owner, class_name: 'User' | |
validates :owner, presence: true | |
validates :name, presence: true, length: { minimum: 6, maximum: 255 } | |
validates :description, length: { maximum: 255 }, allow_blank: true | |
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
/config/routes.rb | |
------------------------------------------------------------------------ | |
get '/products/update_productsubgroups', as: 'update_productsubgroups' | |
get '/update_productsubgroups' => 'products#update_productsubgroups' | |
resources :prodducts | |
/app/assets/javascript/products.coffee | |
------------------------------------------------------------------------ | |
$ -> | |
$(document).on 'change', '#productgroups_select', (evt) -> |
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 ApplicationController < ActionController::Base | |
include UserAuthentication | |
end |