This project is archived and is in readonly mode.
Deprecation problem with Errors#invalid?(attribute)
-
David Trasbo
- State changed from new to invalid
- Importance changed from to Low
Unable to reproduce on edge Rails:
$ script/rails g controller territories new ... $ script/rails g model territory ... $ rake db:migrate ...app/views/territories/new.html.erb:<%= form_for @territory do |f| %> <%= f.label :id %> <%= f.text_field :id %> <% end %>app/controllers/territories_controller.rbclass TerritoriesController < ApplicationController def new @territory = Territory.new end endroutes.rb:Ticket5745::Application.routes.draw do resources :territories endA request to
http://localhost:3000/territories/newrenders correctly with no error messages:$ script/rails s => Booting WEBrick => Rails 3.1.0.beta application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-10-09 17:06:23] INFO WEBrick 1.3.1 [2010-10-09 17:06:23] INFO ruby 1.9.2 (2010-08-18) [x86_64-darwin10.4.0] [2010-10-09 17:06:23] INFO WEBrick::HTTPServer#start: pid=14814 port=3000 Started GET "/territories/new" for 127.0.0.1 at 2010-10-09 17:07:22 +0200 Processing by TerritoriesController#new as HTML Rendered territories/new.html.erb within layouts/application (7.2ms) Completed 200 OK in 19ms (Views: 10.4ms | ActiveRecord: 0.0ms)Besides: Making the
idcolumn a user input is, mildly speaking, an extremely bad idea, and you should expect to encounter problems. -
Diego Plentz
David, you're right. These messages are being displayed because of a gem I'm using (delocalize_it). Sorry for the inconvenience.