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
%script{:src => "https://checkout.stripe.com/checkout.js"} | |
:javascript | |
var handler = StripeCheckout.configure({ | |
key: '#{Rails.configuration.stripe[:publishable_key]}', | |
locale: 'auto', | |
name: 'foobar', | |
description: 'Donation', | |
token: function(token) { | |
$('input#stripeToken').val(token.id); | |
$('form').submit(); |
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
class ChargesController < ApplicationController | |
def new | |
end | |
def create | |
@amount = params[:amount] | |
@amount = @amount.gsub('$', '').gsub(',', '') | |
begin |
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
def create | |
@amount = params[:amount] | |
@amount = @amount.gsub('$', '').gsub(',', '') | |
begin | |
@amount = Float(@amount).round(2) | |
rescue | |
flash[:error] = 'Charge not completed. Please enter a valid amount in USD ($).' | |
redirect_to new_charge_path |
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 reloadSubCategories (category, submenu) { | |
if (category && submenu) { | |
$('#new_subcategory').attr('action', '/admin/categories/' + category + '/submenus/'+ submenu + '/subcategories') | |
$.getScript('/admin/categories/'+ category +'/submenus/'+ submenu +'/subcategories'); | |
} else { | |
$('#post_subcategory_id').empty(); | |
} | |
} | |
$('#new_post').parent().on('change', '#new_post', function(e){ |
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 reloadSubCategories (category, submenu) { | |
if (category && submenu) { | |
$.getScript('/admin/categories/'+ category +'/submenus/'+ submenu +'/subcategories'); | |
} else { | |
$('#post_subcategory_id').replaceWith("<select name='post[subcategory_id]' id='post_subcategory_id'></select>" ); | |
} | |
} | |
$('#post_category_id').parent().on('change', '#post_category_id', function(e){ | |
var cat = this.value; |
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_category_id').change(function(e){ | |
var cat = this.value | |
$.getScript('/admin/categories/' + this.value + '/submenus', function(e){ | |
var submenu = $('#post_submenu_id').val(); | |
if (submenu == null) { | |
} else { | |
$.getScript('/admin/categories/' + cat + '/submenus/' + submenu + '/subcategories') | |
} | |
}) | |
}) |
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
Conversion Class 1102: The laws of Prayer: | |
Introduction Part 2 | |
I. Communal Worship | |
A. The Merit of Communal Worship | |
1. One of the distinctive features of Jewish prayer from its earliest | |
beginnings was this emphasis on communal or congregational | |
worship. One may fulfill the mitzvah of prayer by praying | |
privately (and there will be a distinction between women and |
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
if category = category.subcategories.where(title: subcategory).present? | |
subcategory category.subcategories.where(title: subcategory) | |
else | |
subcategory = Subcategory.create(category_id: category_id, title: subcategory) | |
end |
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
- Category.all.each do |category| | |
%li | |
= link_to(category.title, category_path(category)) | |
- unless category.subcategories.blank? | |
%ul | |
- category.subcategories.each do |subcat| | |
%li | |
= link_to(subcat.title, category_subcategory_posts_path(category, subcat)) |