开发者

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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜