如何在 Rails 3 表单中使用 Dojo Dijit 主题
我正在尝试在 Rails 3 表单中使用 Dojo 数字主题。下面是我尝试将 Dojo 合并到 Devise views/sessions/new.html.erb 文件中。登录名和密码文本框使用 Dojo 主题显示,但不使用复选框或“登录”提交按钮。
<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 :remember_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" %>
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 :remember_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" %>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否记得在您的 js 中需要复选框和按钮?
Did you remember to require the checkbox and the button, in your js?