Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 Spree Commerce:结帐时显示空白付款信息表单_Ruby On Rails 4_Spree_Stripe Payments_Spree Paypal Express - Fatal编程技术网

Ruby on rails 4 Spree Commerce:结帐时显示空白付款信息表单

Ruby on rails 4 Spree Commerce:结帐时显示空白付款信息表单,ruby-on-rails-4,spree,stripe-payments,spree-paypal-express,Ruby On Rails 4,Spree,Stripe Payments,Spree Paypal Express,以前正在工作,但在最新更新时,结帐付款信息表单在显示信用卡字段和paypal选项时不会显示任何信息 在管理面板中,我包含了所有Spree和Paypal express信息。我为签出编辑表单使用自定义视图文件(见下文) 我在错误日志中找不到任何问题 更新:javascript错误如下所示: Gemfile app/views/spree/checkout/edit.html.erb $(文档).ready(函数(){ $('.支付选项标签:第n个子项(1)')。在('单击')上,函数(){

以前正在工作,但在最新更新时,结帐付款信息表单在显示信用卡字段和paypal选项时不会显示任何信息

在管理面板中,我包含了所有Spree和Paypal express信息。我为签出编辑表单使用自定义视图文件(见下文)

我在错误日志中找不到任何问题

更新:javascript错误如下所示:

Gemfile app/views/spree/checkout/edit.html.erb

$(文档).ready(函数(){
$('.支付选项标签:第n个子项(1)')。在('单击')上,函数(){
$(“#付款方式李:第n个孩子(1)”.show();
$(“#付款方式李:第n个孩子(2)”.hide();
});
$('.payment options li:nth child(2)label')。在('click',函数(){
$(“#付款方式li:n子项(1)”.hide();
$(“#付款方式李:第n个孩子(2)”.show();
});
$('.payment options li:n子项(2)标签')。单击();
$(“#付款方式李:第n个孩子(2)”.show();
$(“#使用_现有_卡_是”)。在('click',函数(){
$(“div[data hook='checkout\u payment\u step'])。hide();
$(“表[data hook='existing_cards'])。show();
});
$(“#使用_现有_卡号”)。在('click',函数(){
$(“div[data hook='checkout\u payment\u step'])。show();
$(“表[data hook='existing_cards'])。hide();
});
$(“#使用_现有_卡_是”)。单击();
$(“div[data hook='checkout\u payment\u step'])。hide();
});
'spree/shared/error_messages',:locals=>{:target=>@order}%>
'spree/layouts/shared/wizard',:locals=>{:target=>@order}%>
更新签出路径(@order.state),:html=>{:id=>“签出表单{@order.state}”}do |表单{124;%>


表格%> 'summary',:locals=>{:order=>@order}%> Spree.current_order_id=“” Spree.current_order_token=“”
这似乎表明jquery.payment——提供
.payment
函数的库——根本没有被加载。您能在新的应用程序中重现此功能吗?

谢谢。就这样。我在该页面上手动加载了库,现在可以正常工作了。:)
source 'https://rubygems.org'
#ruby=ruby-2.1.0

ruby '2.1.0'
gem 'rails', '4.0.5'

group :development, :test do
    gem 'sqlite3'
  gem 'better_errors'
  gem 'binding_of_caller'
end


# Use sqlite3 as the database for Active Record
# gem 'pg'
# gem 'mysql'
  gem 'mysql'
gem "font-awesome-rails"
gem 'money', '5.1.1'
gem 'sass-rails', '4.0.3'
gem 'bootstrap-sass', '3.1.1.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.1.0'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
gem 'aws-sdk'
gem 'highline', '1.6.21'
gem 'paperclip'
gem 'fog'
gem 'deface'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'unicorn'
  gem 'unicorn-worker-killer'
  gem 'rails_12factor', '0.0.2'
end

gem 'spree', github: 'spree/spree', branch: '2-2-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-2-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-2-stable'
gem 'spree_paypal_express', :github => "radar/better_spree_paypal_express", :branch => "2-2-stable"
gem 'spree_static_content', github: 'spree/spree_static_content', branch: '2-2-stable'
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '2-2-stable'
gem 'spree_active_shipping', :git => "git://github.com/spree/spree_active_shipping", :branch => "2-2-stable"
gem 'spree_contact_us', :git => 'https://github.com/jdutil/spree_contact_us', :branch => '2-2-stable'
gem 'spree_chimpy', github: 'DynamoMTL/spree_chimpy'
<script>
$(document).ready(function () {
  $('.payment-options label:nth-child(1)').on('click', function () {
      $('#payment-methods li:nth-child(1)').show();
      $('#payment-methods li:nth-child(2)').hide();
  });
  $('.payment-options li:nth-child(2) label').on('click', function () {
    $('#payment-methods li:nth-child(1)').hide();
    $('#payment-methods li:nth-child(2)').show();
  });
  $('.payment-options li:nth-child(2) label').click();
  $('#payment-methods li:nth-child(2)').show();

$('#use_existing_card_yes').on('click', function () {
    $("div[data-hook='checkout_payment_step']").hide();
      $("table[data-hook='existing_cards']").show();
});
$('#use_existing_card_no').on('click', function () {
    $("div[data-hook='checkout_payment_step']").show();
    $("table[data-hook='existing_cards']").hide();
});
  $('#use_existing_card_yes').click();
  $("div[data-hook='checkout_payment_step']").hide();


  });

</script>
<div id="checkout" data-hook>
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } %>

  <div class="row" data-hook="checkout_header">
    <div class="checkout-header" class="col-sm-3">
    <h2 class="columns three alpha" data-hook="checkout_title"><%= Spree.t(:checkout) %></h2>
  </div>
  <%= render :partial => 'spree/layouts/shared/wizard', :locals => { :target => @order } %>
</div>
  <div class="row" data-hook="checkout_content">
    <div class="<%= if @order.state != 'confirm' then 'col-md-9' else 'col-md-12' end %>" data-hook="checkout_form_wrapper">
      <%= form_for @order, :url => update_checkout_path(@order.state), :html => { :id => "checkout_form_#{@order.state}" } do |form| %>
        <% unless @order.email? %>
          <p class="field" style='clear: both'>
            <%= form.label :email %><br />
            <%= form.text_field :email %>
          </p>
        <% end %>
        <%= render @order.state, :form => form %>
      <% end %>
    </div>

    <% if @order.state != 'confirm' %>
      <div id="checkout-summary" data-hook="checkout_summary_box" class="col-md-3">
        <%= render :partial => 'summary', :locals => { :order => @order } %>
      </div>
    <% end %>
  </div>
</div>

<script>
Spree.current_order_id = "<%= @order.number %>"
Spree.current_order_token = "<%= @order.token %>"
</script>

<% if I18n.locale != :en %>
  <script src="<%= assets_prefix %>/jquery.validate/localization/messages_<%= I18n.locale %>.js"></script>
<% end %>