1 Replies - 1024 Views - Last Post: 14 March 2014 - 10:15 PM Rate Topic: -----

#1 rifkijones  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-March 14

Using Ruby html.erb file without MVC

Posted 14 March 2014 - 04:04 AM

HI

I know this isn't good practice and certainly not what rails is all
about but is this possible. I need to customize my CRM to use stripe
which it doesn't support at present.the CRM is written in Ruby and has a
number of rhtml pages.

Can I add my own display page of html.erb extension to these pages to receive a variable on one of the CRM's
existing pages written as: <%= (basket.to_f_withvat).to_money %> On this stand alone page. I can then assign this variable:
'basket_total = (basket.to_f_withvat).to_money' and then use this to pay with the Stripe
Gateway as below

Code Ruby:

begin
  charge = Stripe::Charge.create(
    :amount => basket_total, # This is your value as a variable.
    :currency => "usd",
    :card => token,
    :description => "payinguser@example.com"



---- etc
Again I know this isn't what RoR and MVC is all about, but it's the only
way I can think of doing this.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Using Ruby html.erb file without MVC

#2 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1377
  • View blog
  • Posts: 3,501
  • Joined: 28-November 09

Re: Using Ruby html.erb file without MVC

Posted 14 March 2014 - 10:15 PM

Which gem are you using to do this? I'd need a lot more context than this to give you an answer.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1