2014-01-11 9 views
0

爲出生日期創建壓延我一直在關注 http://railscasts.com/episodes/213-calendars?autoplay=true使用jQuery文件

我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! %> 

回答

0

似乎是Windows/ExecJS相關的問題。你可以找到這個解決方案 here