不与jquery文件连接

时间:2014-01-11 06:44:17

标签: javascript ruby-on-rails jquery-ui devise

为了创建出生日期的日历我一直在关注 http://railscasts.com/episodes/213-calendars?autoplay=true

我的home.html页面是

<%= stylesheet_link_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css","application" %>
<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js", "application" %>
<%= image_tag("cubeimage.jpg",:alt => "CUBE", :class => "round", :width => "200px")%>


<marquee><h2 style="color:blue"> WELCOME TO CUBE</h2> </marquee>
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<div id="teachers_nav">
<% if teacher_signed_in? %>
Signed in as <%= current_teacher.email %>. Not you?
<%= link_to "Sign Out", destroy_teacher_session_path, :method => "DELETE" %>

<% else %>
<h5><%= link_to "Sign up",new_teacher_registration_path %> or <%= link_to "Sign in", new_teacher_session_path %></h5>
<% end %>
<%= yield %>
</div>

我的设计注册页面是

<hr style="color:blue;width:1300;height:10;"></hr>
<h2>Register</h2>


<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>

<fieldset>
<legend>ACCOUNT DETAILS </legend>
  <div><%= f.label :email %><br />
 <%= f.email_field :email, :autofocus => true %></div>

 <div><%= f.label :password %><br />
  <%= f.password_field :password %></div>

  <div><%= f.label :password_confirmation %><br />
  <%= f.password_field :password_confirmation %></div></fieldset>

  <fieldset>
  <legend> PERSONAL DETAILS </legend>
  <div><%= f.label :teacherid %><br />
  <%= f.text_field :teacherid, :autofocus => true %></div>

  <div><%= f.label :firstname %><br />
  <%= f.text_field :firstname, :autofocus => true %></div>

  <div><%= f.label :lastname %><br />
  <%= f.text_field :lastname, :autofocus => true %></div>

  <div><%= f.label :Gender %>
   <%= f.radio_button :gender, :autofocus => true %>
 <%= f.label :gender, "Male", :value => "true" %>
 <%= f.radio_button :gender, :autofocus => false , :checked => true %>
 <%= f.label :gender, "Female", :value => "false" %>
 </div>

  <div><%= f.label :address %><br />
  <%= f.text_area :address, :autofocus => true %></div>

   <div><%= f.label :'Mobile number' %><br />
   <%= f.text_field :phonenumber, :autofocus => true %></div>

  <div><%= f.label :'father/husband name' %><br />
   <%= f.text_field :f_h_name, :autofocus => true %></div>

    <div><%= f.label :date_of_birth %><br />
   <%= f.text_field :date_of_birth %> <!--:autofocus => true, :start_year => Time.now.year - 58, :end_year => Time.now.year - 21, :order => [:day, :month, :year] %>--></div>
   </fieldset>
   <fieldset><legend> EDUCATION DETAILS </legend>

   <div><%= f.label :qualification %><br />
    <%= f.text_field :qualification, :autofocus => true %></div>

    <div><%= f.label :specialization %><br />
    <%= f.text_field :specialization, :autofocus => true %></div>

     <div><%= f.label :awards %><br />
      <%= f.text_field :awards, :autofocus => true %></div>

     <div><%= f.label :experience %><br />
      <%= f.text_field :experience, :autofocus => true %></div>

      <div><%= f.label :date_of_joining %><br />
     <%= f.date_select :date_of_joining, :autofocus => true, :start_year => Time.now.year - 20, :end_year => Time.now.year, :order => [:day,:month,:year] %></div>

  </fieldset>

    <div><%= f.submit "Register" %></div>
   <% end %>

   <%= render "devise/shared/links" %>

但是当我运行rails服务器时它会显示错误

ExecJS::RuntimeError in Devise::Registrations#new
Showing C:/Sites/cube_project/app/views/devise/registrations/new.html.erb where line #4 raised:


  (in C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/turbolinks-2.1.0/lib/assets/javascripts/turbolinks.js.coffee)
Extracted source (around line #4):
   1         <hr style="color:blue;width:1300;height:10;"></hr>
   2   <h2>Register</h2>
   3     <%= stylesheet_link_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css","application" %>
   4  <%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js", "application" %>

   5  <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
   6   <%= devise_error_messages! %>

1 个答案:

答案 0 :(得分:0)

似乎是Windows / ExecJS相关问题。您可以找到此 here

的解决方案