флажок не работает для устройства и jquerymobile - PullRequest
2 голосов
/ 24 января 2012

просто работаю над простой формой регистрации с devise, и я использую jquerymobile для своего мобильного макета, но всякий раз, когда я пытаюсь зарегистрироваться и отмечаю флажок, он не отправляет значение в базу данных.Как я могу это исправить.Моя форма регистрации выглядит следующим образом:

<div data-role="page" class="home" class="ui-seablue" data-theme="b" data-backbtn="true" >
    <header data-role="header" data-theme="a" class="heading">
        <h1 >SignIn</h1>
     <nav data-role="navbar" align="CENTER" id="navbar" data-iconpos="bottom">
       <ul>
         <li>
            <%= link_to "Home", root_url, :class => "nav-link", "data-icon"=>"home",  "data-theme"=>"a"%>
         </li>
         <li>
              <%= link_to "SignIn/SignUp", new_user_session_path, :class => "nav-link", "data-icon"=>"gear",  "data-theme"=>"a" %>
         </li>
       </ul>
     </nav>
    </header><!-- /header -->
    <div data-role="content" data-tab="tab-content"  class="ui-seablue">

 <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>

   <div data-role="fieldcontain">
     <%= f.label :name, "Art name/username" %>
     <%= f.text_field :name %>
   </div>

   <div data-role="fieldcontain">
      <%= f.label :artist, "Check the box below to register as an artist" %>
      <%= f.check_box :artist %>
    </div>

    <div data-role="fieldcontain">
     <%= f.label :real_name, "Real name" %>
     <%= f.text_field :real_name %>
    </div>

  <div data-role="fieldcontain">
  <%= f.label :email %>
  <%= f.email_field :email %>
  </div>

  <div data-role="fieldcontain">
  <%= f.label :password %>
  <%= f.password_field :password %>
  </div>

  <div data-role="fieldcontain">
  <%= f.label :password_confirmation %>
  <%= f.password_field :password_confirmation %>
  </div>


<div class="ui-body ui-body-a double-margin-top">
     <%= f.submit "Sign Up", :class => "button" %>
     <%= link_to "Sign In", new_user_session_path, "data-role" => "button" %>

</div>


<% end %>
    </div><!-- /content -->

    <div data-role="footer" class="maroon-deep" align="CENTER" id="footer">
        <a>Powered by Rzaartz </a>
    </div><!-- /footer -->
</div><!-- /page -->

Когда я отмечаю флажок и проверяю свой журнал сервера, чтобы увидеть проблему, он показывает, что значение равно 0, и мой журнал сервера показывает

Started POST "/users" for 127.0.0.1 at 2012-01-23 22:52:54 +0100
  Processing by Devise::RegistrationsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"RhK5gALMrn5I+C8EYIBnoRED6A8ZyqDk+wPwYBNDtao=", "user"=>{"name"=>"abiodun", "artist"=>"0", "real_name"=>"rzaartz", "email"=>"a@y.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign Up"}
   (0.2ms)  BEGIN
   (0.7ms)  SELECT 1 FROM `users` WHERE `users`.`email` = BINARY 'a@y.com' LIMIT 1
   (0.7ms)  SELECT 1 FROM `users` WHERE `users`.`name` = BINARY 'abiodun' LIMIT 1
  SQL (0.6ms)  INSERT INTO `users` (`about`, `admin`, `artist`, `confirmation_sent_at`, `confirmation_token`, `confirmed_at`, `created_at`, `current_sign_in_at`, `current_sign_in_ip`, `email`, `encrypted_password`, `facebook_username`, `icon_content_type`, `icon_file_name`, `icon_file_size`, `icon_updated_at`, `last_sign_in_at`, `last_sign_in_ip`, `name`, `notes_count`, `permalink`, `pictures_count`, `real_name`, `remember_created_at`, `reset_password_sent_at`, `reset_password_token`, `rpx_identifier`, `sign_in_count`, `songs_count`, `twitter_username`, `updated_at`, `username`, `videos_count`) VALUES (NULL, 0, 0, NULL, NULL, NULL, '2012-01-23 21:52:55', NULL, NULL, 'a@y.com', '$2a$10$YLXChJBa/7HAobRvCFwGUO2j5/TMezdPxKVs5WofJJwx1l/K5xqta', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'abiodun', 0, 'abiodun', 0, 'rzaartz', NULL, NULL, NULL, NULL, 0, 0, NULL, '2012-01-23 21:52:55', NULL, 0)
[paperclip] Saving attachments.
   (1.4ms)  COMMIT
   (0.2ms)  BEGIN
   (0.6ms)  UPDATE `users` SET `last_sign_in_at` = '2012-01-23 21:52:55', `current_sign_in_at` = '2012-01-23 21:52:55', `last_sign_in_ip` = '127.0.0.1', `current_sign_in_ip` = '127.0.0.1', `sign_in_count` = 1, `updated_at` = '2012-01-23 21:52:55' WHERE `users`.`id` = 2
[paperclip] Saving attachments.
...