RailsCasts Pro episodes are now free!

Learn more or hide this

Joe Jackson's Profile

GitHub User: joeyjoejoejr

Comments by Joe Jackson

Avatar

You can just set reasonable defaults in your presenter class's method definitions

ruby
class UserPresenter < BasePresenter
  def some_method(size = 1)

  end
end
Avatar

You can also add another newline between the object declaration and the call to createToken.

processCard: ->
  card =
    {number: $('#card_number').val(),
    cvc: $('#card_code').val(),
    expMonth: $('#card_month').val(),
    expYear: $('#card_year').val()}

  Stripe.createToken(card, subscription.handleStripeResponse)
Avatar

For anyone not using rails, there is one tricky bit. here:

ruby
RSpec.configure do |c|
  c.treat_symbols_as_metadata_keys_with_true_values = true
  c.around(:each, :vcr) do |example|
    name = example.metadata[:full_description].split(/\s+/, 2).join("/").underscore.gsub(/[^\w\/]+/, "_")
    options = example.metadata.slice(:record, :match_requests_on).except(:example_group)
    VCR.use_cassette(name, options) { example.call }
  end
end

The underscore method is a rails helper, but is unnecessary here because gsub(/[^\w\/]+/, "_") already takes care of any non-word character that's not a slash.

Avatar

If this is how you handle deletion application wide, then I don't see a problem with it. All resources already have a destroy action.

Avatar

I just had this problem, you need to set capistrano to symlink youre public/whatever directory to a shared directory of your choosing.

See the answer to this stack overflow question
http://stackoverflow.com/questions/4648180/keep-unversioned-files-when-deploying-with-capistrano

Avatar

I found this to be the case on my Linode running with lucid. Thanks for the tip.

Avatar

Thanks so much Ryan.

I has been beating my head against the wall trying to deploy on a clean unix box for days. This was straight forward and super easy to follow. I also love using vagrant to test my setup!

Keep em coming, best $9 a month I can imagine sending.

Avatar

Thanks for the amazing material. At $10 a month this is the most valuable development resource I've come across.

If anyone is having trouble getting the checkboxes to save make sure you make your assocation_ids accessible.