rails使用html form,Rails submit html form in addition to model form

I'm fairly new to rails with very small knowledge of javascript. That's the disclaimer :)

I'm using simple form and haml in a rails app to create an instance of a model. The code is simple, and works well. It's essentially this...

= simple_form_for @account, :validate => true, :url => { :action => 'create' } do |account|

= account.input :name, :placeholder => "Company name", :label => false

= account.input :first_name, :placeholder => "First name", :label => false

= account.input :last_name, :placeholder => "Last name", :label => false

= account.submit "Create my account"

I have simplified the above.

My sales team have come to me and asked me to create a lead in salesforce every time a new account is created. Salesforce have functionality at the cheap end called web to lead, which is essentially a web form. Again, a simplified version of the form looks like this...

First Name

Last Name

Company

now, my thoughts are that I can populate this form with variables from the screen and then somehow get the rails simple_form to submit the html form when it is submitted. I have access to guys who know java and ajax if necessary, but I'm looking for the best and easiest solution.

so my two questions are

Is it possible to have a hidden form and have the simple_form submit button submit both forms

what's the best approach to this problem

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值