Rails 3: ariza joylari xato bilan qaytarilganda "rost" so'zini o'zgartiradi

Men ustida ishlayotgan Rails 3 ilovasi bor. Menda mukammal ishlaydigan ko'plab shakllar bor. Brauzerda ularni qo'lda sinab ko'rganimdan beri biroz vaqt o'tdi. Men ulardan foydalanishni yaxshilash uchun formalar va flesh-xabarlarni ba'zi CSS va uslublardagi o'zgarishlar qildim va ularni sinab ko'rganimda ularning barchasi ishlamay qolganini aniqladim.

Shakl joriy ma'lumotlarga ega bo'lsa, muammo yo'q. Lekin men noto'g'ri ma'lumotni taqdim etganimda va arizam tasdiqlashdan qaytib kelganida xatolarni kutilgandek qabul qildingiz, lekin kirish va kirish sifatida ishlatilgan joyda endi oddiy so'zlar (juda g'alati) mavjud.

Men bu yerda kimdir bu kabi g'ayritabiiy bir narsaga duch kelganmi yoki yo'qligini bilib qolsam, deb o'ylayman.

Mana ekran tasvirlari

Pre-Submission missing required fields Pre-Submission missing required fields

Post-Submission returning with errors but Labels and Inputs no longer rendering Post-Submission returning with errors but Labels and Inputs no longer rendering

Mening shaklim shunday ko'rinadi

<script language="javascript" type="text/javascript">
    $(function() {
        $('#weight_entry_date_time').datetimepicker( { dateFormat: 'yy-mm-dd', ampm: true } );
    });
</script>

<%= form_for(@weight_entry) do |f| %>
  <% if @weight_entry.errors.any? %>
    <div id="error_explanation">
      

<%= pluralize(@weight_entry.errors.count, "error") %> prohibited this entry from being saved:

    <% @weight_entry.errors.full_messages.each do |msg| %>
  • <%= msg %>
  • <% end %>
</div> <% end %> <div> <% if current_user.profile.metric_scale? %> Enter all values in Kilograms
(you are using Metric Units) <% else %> Enter all values in Pounds
(you are using American Units) <% end %> </div> <% puts 'test: ' + f.inspect %> <table class="entry"> <tr> <td class="field_title required"> <%= f.label :weight %> </td> <td> <%= f.text_field :weight %> (format: 0.000) </td> </tr> <tr> <td class="field_title required"><%= f.label :date_time, "Date/Time" %></td> <td> <% if @weight_entry.date_time %> <%= f.text_field :date_time, :value => nice_date_form(@weight_entry.date_time) %> <% else %> <%= f.text_field :date_time %> <% end %> (format: yyyy-mm-dd hh:mm pm) </td> </tr> </table> <div class="actions"> <%= f.submit 'submit', :class => 'btn primary' %> </div> <% end %>

Mening modelim bunga o'xshaydi

class WeightEntry < ActiveRecord::Base
  attr_accessible :user_id, :weight, :date_time

  # Relationships
  belongs_to :user

  # Validations
  validates :user_id, :date_time, :presence => true
  validates :weight, :presence => true, :numericality => { :greater_than => 0 }
end

Mana, men GEMSni o'z ichiga olgan va dasturda qo'llayman

source 'http://rubygems.org'

# System Gems
gem 'rails', '3.0.9'
gem 'mysql2', '0.2.7'
gem 'seed-fu', '2.0.1'

# Security Gems
gem 'devise', '1.2.1'
gem 'cancan', '1.6.4'
gem 'recaptcha', '0.3.1', :require => 'recaptcha/rails'
gem 'rufus-mnemo', '1.2.0'

# Social Gems
gem 'gravatar_image_tag', '1.0.0.pre2'

# UI/AJAX Gems
gem 'jquery-rails', '>= 0.2.6'
gem 'will_paginate', '3.0.pre2'
gem 'client_side_validations', '3.0.4'
gem 'lazy_high_charts', '1.1.1'

# Utility Gems


# Testing Gems
gem 'faker', '0.3.1'
gem 'rspec-rails', '2.6.1', :group => [:test, :development]
group :test do
  gem 'rspec', '2.6.0'
  gem 'capybara', '1.0.0'
  gem 'factory_girl_rails', '1.0.1'
  gem 'populator', '1.0.0'
end
0
Siz CSS-da ariza elementlarining ekranini (fliars xabarlarni emas) o'zgartirishni xohlaysizmi? Bundan tashqari, siz biron-bir JavaScript tahrir qildingizmi? WeightEntry modelidagi ustun nomi/usul nomi o'zgarishi haqida nima deyish mumkin?
qo'shib qo'ydi muallif jefflunt, manba
Displeyni o'zgartirish uchun CSS-ga hech qanday o'zgartirish yo'q. hech qanday JavaScript o'zgarishi, modeldagi o'zgarish yo'q.
qo'shib qo'ydi muallif Schleichermann, manba

Javob yo'q

0