0

次の手順で calendar_date_select をインストールしました

gemfileに追加

# To use calendar_date_select
gem 'calendar_date_select', :git => 'git://github.com/paneq/calendar_date_select.git'

バンドル インストール

bundle install

私のapplication.html.erbは次のようになります

<head>
  <title><%= full_title(yield(:title)) %></title>
  <%= stylesheet_link_tag    "application", media: "all" %>
  <%= javascript_include_tag "prototype" %>
  <%= javascript_include_tag :defaults %> 
  <%= calendar_date_select_includes "silver" %>     
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
  <%= render 'layouts/shim' %>
</head>

次に、この行を使用してカレンダーからデータを取得しました。

<%= calendar_date_select_tag "startdate", nil, :embedded => true, :year_range =>  10.years.ago..0.years.ago %>

これはページのソースがどのように見えるかです

<input id="startdate" name="startdate" type="hidden" /><span id="cds_placeholder_89036" style="display: none; position: absolute;"></span><script type="text/javascript">

///

しかし、ブラウザにプラグインが表示されません。

4

1 に答える 1

0

JavaScript がページにロードされていない可能性があります。<%= calendar_date_select_includes %>レイアウトの head セクションに追加する必要がある場合があります。

編集 1: 申し訳ありませんが、あなたの情報源に表示されます。

編集2:<%= calendar_date_select_includes "silver" %>後にある必要があります<%= javascript_include_tag "application" %>

于 2012-07-05T02:00:19.797 に答える