This file contains hidden or 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
Source: /knowledge/articles/(?!page).+/.+/(.+)/?$ | |
Destination: /knowledge/articles/$1 | |
basically it only keeps /knowledge/articles/foo | |
instead of /knowledge/articles/foo/bar/biz | |
get '/knowledge/articles/:id/:s2/:s3', to: 'posts#show', constraints: { id: /(?!page).+/ } |
This file contains hidden or 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
new_client = 'https://jewsforjudaism.api-us1.com/api/3/contacts' | |
new_tag = 'https://jewsforjudaism.api-us1.com/api/3/contatTags/' | |
headers = { | |
"Api-token" => api_key, | |
"Content-Type" => "application/json", | |
"Accept" => "application/json" | |
} | |
This file contains hidden or 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
{"tags"=> | |
[{"tagType"=>"contact", "tag"=>"Sample value", "description"=>"", "cdate"=>"2016-11-20T22:37:51-06:00", "subscriber_count"=>"0", "links"=>{"contactGoalTags"=>"https://jewsforjudaism.api-us1.com/api/3/tags/1/contactGoalTags"}, "id"=>"1"}, | |
{"tagType"=>"contact", "tag"=>"German", "description"=>"", "cdate"=>"2016-11-20T22:37:51-06:00", "subscriber_count"=>"0", "links"=>{"contactGoalTags"=>"https://jewsforjudaism.api-us1.com/api/3/tags/2/contactGoalTags"}, "id"=>"2"}, | |
{"tagType"=>"contact", "tag"=>"Videos", "description"=>"", "cdate"=>"2016-11-20T22:37:51-06:00", "subscriber_count"=>"0", "links"=>{"contactGoalTags"=>"https://jewsforjudaism.api-us1.com/api/3/tags/3/contactGoalTags"}, "id"=>"3"}, | |
{"tagType"=>"contact", | |
"tag"=>"How can I help a friend who's going through a hard time?", | |
"description"=>"", | |
"cdate"=>"2016-11-20T22:37:51-06:00", | |
"subscriber_count"=>"8", | |
"links"=>{"contactGoalTags"=>"https://jewsforjudaism.api-us1.com/api/3/tags/4/contactGoalTags"}, |
This file contains hidden or 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
:javascript | |
$("#document_list").sortable({ | |
update: function(e, ui) { | |
Rails.ajax({ | |
url:$(this).data('url'), | |
type: "PATCH", | |
data: $(this).sortable('serialize'), | |
}); | |
} |
This file contains hidden or 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
function fileUpload(fileInput) { | |
var uppy = Uppy.Core({ autoProceed: true }) | |
.use(Uppy.FileInput, { target: '#graphic_upload', | |
pretty: true, | |
inputName: 'uploading_image',}) // adds a pretty file field | |
.use(Uppy.ProgressBar, { target: "#ProgressBar" , fixed: false, hideAfterFinish: true}) // displays a progress bar | |
.use(Uppy.Informer, { /* ... */ }) // displays validation errors | |
uppy.use(Uppy.AwsS3, { | |
getUploadParameters: function (file) { |
This file contains hidden or 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
$("#post_of_type").on('change', foo); | |
function foo(){ | |
switch($("#post_of_type").val()) { | |
case "documents": | |
console.log("foo") | |
break; | |
default: | |
console.log("bar") | |
} |
This file contains hidden or 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
:javascript | |
$("#property-images").sortable({ | |
update: function(e, ui) { | |
Rails.ajax({ | |
url:$(this).data('url'), | |
type: "PATCH", | |
data: $(this).sortable('serialize'), | |
}); | |
} |
This file contains hidden or 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
> {"errors"=> | |
[{"title"=>"Email address is required.", "detail"=>"", "code"=>"field_missing", "source"=>{"pointer"=>"/data/attributes/email"}}]} | |
[6] pry(main)> |
This file contains hidden or 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='group'> | |
<label> | |
<span>Single Player Ticket ($250)</span> | |
<select id='spt_qty' name='single_player_quantity'> | |
<option value='0'>0</option> | |
<option value='1'>1</option> | |
<option value='2'>2</option> | |
<option value='3'>3</option> | |
<option value='4'>4</option> | |
<option value='5'>5</option> |
This file contains hidden or 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
$('#coupon').on('input', function(){ | |
switch( $('#coupon').val() ) { | |
case 'VIPCOMP': | |
$('#poker_button').prop('disabled', false); | |
$('#poker_button').text('RSVP Now'); | |
$('#poker_button').css('background-color', '#666EE8'); | |
$('#coupon_error').addClass('hide'); | |
break; | |
case 'VIPPLAYER': | |
case 'VIPPAYER': |