title: Integrating Chargify (hosted) with a Rails app
body: <p>I'm trying to integrated Chargify's hosted billing with my rails app and am running into some difficulties. </p>
  
  <p>I'm following this tutorial: <a href="http://blog.formedfunction.com/post/4022209767/how-to-integrate-chargify-hosted-payment-pages-with-a" rel="nofollow">http://blog.formedfunction.com/post/4022209767/how-to-integrate-chargify-hosted-payment-pages-with-a</a></p>
  
  <p>And since I'm a total noob, I'm running into a problem here: </p>
  
  <pre><code>     def self.product_id(plan)
         # your own logic to retrieve the Chargify product ID for
         # the plan in question (hint: I store mine in the DB)
       end
  </code></pre>
  
  <p>Basically this is just to connect the URLs to the proper Chargify hosted page... i.e. each plan has a 6 digit ID, and depending on which plan they click on the pricing page, they should be taken to chargify.com/#{self.product_id(plan)}</p>
  
  <p>I'm sure there is a simple solution, I just can't wrap my head around it right now. </p>
  
  <p>Thanks in advance.</p>