Using html.erb as stand alone file


Could anyone tell me if this is possible even with it being bad practice and not using RoR as it was intended, I am looking into customizing my CRM named ‘HostPay’ in order to integrate stripe payments. Hostpay doesn’t support stripe, but It is written in Ruby and containes a number of rhtml files. I’m looking to create a stand alone html.erb file which receives a variable written as `<%= (basket.to_f_withvat).to_money %> from one of the existing files.

On my stand alone page the variable mentioned will be assigned as such:


basket_total = (basket.to_f_withvat).to_money
charge = Stripe::Charge.create(
    :amount => basket_total, # This is your value as a variable.
    :currency => "usd",
    :card => token,
====etc ======

This will then proceed to take card payment with stripe

Of course my file will be nothing to do with the existing CRM structure of views, models and Controllers, but as long as it renders in the browser and can recieve the variable then it wont matter for this situation.
Again, I know this is bad practice but it's the only way i have at present of doing this.

Hope someone can help me with this



I’m not sure if I can help, but is HostPay a Ruby on Rails app? If so, it must be an old one. Rails hasn’t supported rhtml files since version 2. Stripes is actually pretty straightforward. There’s a gem ‘stripes’ you can use, and they have instructions for using their API in Rails at the following link:

sorry, the gem is ‘stripe’ (singular) not ‘stripes’