我如何以%表格返回js?

时间:2015-03-06 17:38:25

标签: ruby-on-rails ruby

如何强制使用js?将我的表单操作更改为:/ portal / checkout.js以纯文本格式呈现代码..我缺少什么?

ruby​​ 1.9.3p194 - Rails 3.1.3

%form#online_bill_pay{:action => "/portal/checkout", :method => "post", :remote => true}
  ...
  = submit_tag "", id: 'pay_amount', class: 'btn-success btn shadowed', remote: true

返回:

Missing template portals/checkout, application/checkout with {:handlers=>[:erb, :builder, :coffee, :haml], :formats=>[:html], :locale=>[:en, :en]}. Searched in: * "/home/pete/Projects/umbie/app/views" * "/home/pete/.rvm/gems/ruby-1.9.3-p194@umbie/gems/jasminerice-0.0.8/app/views" * "/home/pete/.rvm/gems/ruby-1.9.3-p194@umbie/gems/mailboxer-0.5.4/app/views" * "/home/pete/.rvm/gems/ruby-1.9.3-p194@umbie/gems/bootstrap_kaminari-0.0.5/app/views" * "/home/pete/.rvm/gems/ruby-1.9.3-p194@umbie/gems/kaminari-0.14.1/app/views" * "/home/pete/.rvm/gems/ruby-1.9.3-p194@umbie/gems/devise-1.5.0/app/views" * "/home/pete/.rvm/gems/ruby-1.9.3-p194@umbie/gems/doorkeeper-1.0.0/app/views"

1 个答案:

答案 0 :(得分:0)

我解决了我的问题...我的HAML语法正在编译为'remote true'而不是'data remote true'这解决了它:

= form_tag(checkout_portal_path(format: :js), :method => :post, remote: true) do