How to use a Dojo Dijit Theme in a Rails 3 Form
I am trying to use a Dojo Digit Theme in my Rails 3 Form. Below is my attempt to incorporate Dojo in the Devise views/sessions/new.html.erb file. The Login and Password textboxes are displayed using the Dojo theme, but not the CheckBox or "Sign In" submit button.
<h2>Sign in</h2>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :dojoType => "dijit.form.Form") do |f| %>
<p><%= f.label :login %><br />
<%= f.text_field :login, {:dojoType => "dijit.form.TextBox"} %></p>
<p><%= f.label :password %><br />
<%= f.password_field :password, {:dojoType => "dijit.form.TextBox"} %></p>
<% if devise_mapping.rememberable? -%>
<p><%= f.check_box :r开发者_StackOverflowemember_me, {:dojoType => "dijit.form.CheckBox"} %> <%= f.label :remember_me %></p>
<% end -%>
<p><%= f.submit "Sign in", {:dojoType => "dijit.form.Button"} %></p>
<% end %>
<%= render :partial => "devise/shared/links" %>
Did you remember to require the checkbox and the button, in your js?
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.Button");
精彩评论