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
Parameters: {"id"=>"evt_16OXgjDPqmFGZYxBdeTjKnpr", "created"=>1436896769, "livemode"=>false, "type"=>"invoice.payment_succeeded", "data"=>{"object"=>{"date"=>1436896769, "i | |
d"=>"in_16OXgjDPqmFGZYxBnS3fI1CQ", "period_start"=>1436896769, "period_end"=>1436896769, "lines"=>{"object"=>"list", "total_count"=>1, "has_more"=>false, "url"=>"/v1/invoices | |
/in_16OXgjDPqmFGZYxBnS3fI1CQ/lines", "data"=>[{"id"=>"sub_6blDm3XJI0wWaA", "object"=>"line_item", "type"=>"subscription", "livemode"=>false, "amount"=>10, "currency"=>"usd", | |
"proration"=>false, "period"=>{"start"=>1436896769, "end"=>1436983169}, "subscription"=>nil, "quantity"=>1, "plan"=>{"interval"=>"day", "name"=>"Daily Plan", "created"=>14364 | |
63055, "amount"=>10, "currency"=>"usd", "id"=>"Daily Plan", "object"=>"plan", "livemode"=>false, "interval_count"=>1, "trial_period_days"=>nil, "metadata"=>{}, "statement_des | |
criptor"=>"Daily Plan"}, "description"=>nil, "discountable"=>true, "metadata"=>{}}]}, "subtotal"=>10, "total"=>9, "customer"=>"cus_6bNAq2czziHy2u", "o |
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
CSS | |
body { | |
background-color: black; | |
} | |
.main { | |
background-color: white; | |
margin-top: 110px; | |
padding-left: 100px; | |
min-width: 1200px; |
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 create | |
@postcodes = Postcode.all | |
@postcodes.find_each do |p| | |
response = HTTParty.get("https://io.myrheem.com/v1/public/contractors/getcontractorsbyzipandradius?PostalCode=#{p.zip}&Radius=100&bHeatCool=true&bWHRes=false&bWHComm=false&bWHTankless=false&bSolarWH=false&bHomeGen=false&bPoolSpa=false&bDesignStar=false&bKwikComfort=false&bPPlus=false&bCashback=false&bTC=false&bASP=false&bRheem=true&bRuud=false&bPHCC=false").to_json | |
@contractors = JSON.parse(response)[ "Contractors" ] | |
@contractors.to_a.each do |c| | |
contractorname = c["OrganizationName"] | |
if Contractor.exists?(organizationname: contractorname) | |
next | |
else |
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
Lead Model | |
class Lead < ActiveRecord::Base | |
filterrific( | |
default_settings: { sorted_by: 'created_at_asc' }, | |
filter_names: [ | |
:sorted_by, | |
:with_nonleadaction_id, | |
:with_reasoninquiry_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
class ChatsController < ApplicationController | |
def index | |
@chats = Chat.order("created_at DESC") | |
end | |
def new | |
@chat = Chat.new | |
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
Model: | |
class Pin < ActiveRecord::Base | |
attr_accessible :description, :image | |
validates :description, presence: true, length: { :maximum => 140 } | |
validates :user_id, presence: true | |
validates_attachment :image, presence: true, | |
content_type: { content_type: ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'] }, |
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
application.html.erb | |
<div class="modal hide fade in" id="body" > | |
<%= form_for(@weight) do |f| %> | |
<div class="modal-header"> | |
<%= render 'shared/error_messages', object: f.object %> | |
<button type="button" class="close" data-dismiss="modal">×</button> | |
<h3>Record Body Weight</h3> | |
</div> | |
<div class="modal-body" id="datepicker"> |