Dojo Digit Theme рендеринг формы для отправки ввода без текста - PullRequest
0 голосов
/ 13 февраля 2011

У меня есть следующее определение Rails form_for.Как вы можете видеть на снимке экрана, он не отображает текст «Вход» для ввода «Отправить».Я также включил полученный HTML.

<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" %>

enter image description here

HTML

<span class="dijit dijitReset dijitInline dijitButton" dir="ltr" widgetid="user_submit"><span class="dijitReset dijitInline dijitButtonNode" dojoattachevent="ondijitclick:_onButtonClick">
    <span class="dijitReset dijitStretch dijitButtonContents" dojoattachpoint="titleNode,focusNode" wairole="button" waistate="labelledby-user_submit_label" role="button" aria-labelledby="user_submit_label" id="user_submit" tabindex="0" style="-webkit-user-select: none; ">
        <span class="dijitReset dijitInline dijitIcon" dojoattachpoint="iconNode"></span><span class="dijitReset dijitToggleButtonIconChar">●</span>
            <span class="dijitReset dijitInline dijitButtonText" id="user_submit_label" dojoattachpoint="containerNode"></span>
        </span>
    </span>
    <input name="commit" type="submit" value="Sign In" class="dijitOffScreen" dojoattachpoint="valueNode">
</span>

Ответы [ 2 ]

1 голос
/ 18 февраля 2011

Ваш код ERB правильный, он работает нормально.Кажется, у вас проблемы с основным макетом.Вы должны добавить свой раздел определения сценария dojo.Я рекомендую вам создать новый чистый макет для этой концепции.Моя голова на dojo.html.erb

<% = stylesheet_link_tag "default"%> <% = csrf_meta_tag%> <% = javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js',: djconfig => "parseOnLoad: true"%>

0 голосов
/ 19 февраля 2011

Проблема проста: если вы проверяете сэмплы в dojo, кнопка имеет тип кнопки, но rails выдает тип ввода, поэтому он не работает. Вы можете написать в файл erb,

<button dojoType="dijit.form.Button" type="button">Click me too!</button>

это работает, или вы можете написать свой вспомогательный скрипт на application_helper.rb

...