RailsCasts Pro episodes are now free!

Learn more or hide this

meltzerj's Profile

GitHub User: meltzerj

Comments by


Just a note that if you're using Heroku for hosting your production app, they recently released the Heroku Scheduler (heroku blog) which they recommend using instead of Cron. It's much easier to use but I believe only lets you get down to every 10 minutes.


This was amazing... thanks for taking the time to explain things so clearly Ryan.

One small question: When refactoring the collection_check_box code, why do you need to pass record_id and attribute through the send method when calling them on record and object, respectively?


After looking at the ruby send method documentation, is it because record_id and attribute are passed in as symbols?


I personally prefer how you integrated omniauth with Devise in episode #236. Do we need to point the omniauth gem to an earlier version to keep that working?


Wow... eye opening... I, as well, would love another one of these.


When you set the action mailer delivery method in your production config file, where should that method live?


Isn't params[:plan_id] passed in through the url when the form is shown?

But yea, I get the gist of it.


Ahh ok, now I understand. Thanks!

What I would have done was, in the new action, "@plan_id = params[:plan_id]"

Then in the form: <%= f.hidden_field :plan_id, :value => @plan_id %>

To me it seems like less magic is going on by doing it that way.


Got it. But in the create action, isn't he already setting this association when passing in the params hash into Subscription.new()? Doesn't the params hash contain the plan id since the form has a hidden field for the plan id (f.hidden_field :plan_id)? In other words, is he setting the association twice?



A couple of questions:

  1. Why do you pass the API key into the meta tag and grab it in the javascript instead of just hard coding it into the javascript?

  2. In the "save_with_payment" instance method, why do you reference "self" when assigning the customer id to an attribute of the instance.

  3. In the new action of the subscriptions controller, why do you need "@subscription = plan.subscriptions.build"?