Forum: Ruby on Rails Argument Errors in Forms => Rails 1.2.2

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eddie S. (Guest)
on 2007-02-24 07:12
Anyone else experiencing argument errors with select and/or radio
buttons that wrap around models?

I'm using form for, and when i pass something like:

<%= form.select :object, @collection  %>
# or options_for_select(@collection))

it'll say: argument error 1 for 0... so i'll poke around and when i do

<%= form.select %>, or <%= form.select :object %>

it'll say: argument error 0 for 2, and 1 for 2, respectively.

?
Conrad T. (Guest)
on 2007-02-24 07:23
(Received via mailing list)
Hey Dominic, what's the representation of @collections and is it the
result of a database query?  Please provide more detail.  OK?

-Conrad
Eddie S. (Guest)
on 2007-02-25 10:20
Hey Conrad, there's bad news when my scaffolding will yield the same
errors.. so i may have messed something up somewhere. I'll just be
re-installing instantrails here..

Conrad T. wrote:
> Hey Dominic, what's the representation of @collections and is it the
> result of a database query?  Please provide more detail.  OK?
>
> -Conrad
Eddie S. (Guest)
on 2007-02-25 14:19
Somethings wrong with my ActiveRecord within my app ever since upgrading
from 1.6 to 1.2.2.

Is it possible some plugin is interfering with AR? Besides a text_field,
everything inside a form builder does not work (select, radio_box,
etc)..even through a scaffold..

yet when i scaffold a fresh new project, it does work...

ideas and/or thoughts would be great right now.

Dominic S. wrote:
> Hey Conrad, there's bad news when my scaffolding will yield the same
> errors.. so i may have messed something up somewhere. I'll just be
> re-installing instantrails here..
>
> Conrad T. wrote:
>> Hey Dominic, what's the representation of @collections and is it the
>> result of a database query?  Please provide more detail.  OK?
>>
>> -Conrad
Conrad T. (Guest)
on 2007-02-25 15:56
(Received via mailing list)
Hey Dominic, did you update your environment.rb to use rails 1.2.2
instead of 1.1.6?  Also, you'll need to perform the following:

rake rails:update

-Conrad
Eddie S. (Guest)
on 2007-02-26 05:58
Yes. I did all of that...well..I finally found the problem. It deals
with in_place_editing. It's because i was using an extension found at:
http://www.akuaku.org/archives/2006/08/in_place_ed...


Below is the source of the problem:

ActionView::Helpers::InstanceTag.class_eval do
    attr_writer :nil_content_replacement

    def value
      unless object.nil?
        v = object.send(@method_name)
        if @nil_content_replacement.nil?
          return v
        else
          (v.nil? || v.to_s.strip=='') ? @nil_content_replacement : v
        end
      end
    end
  end

I'm not going to lie. I have no idea what is going on there for it to
screw up the form builder...At least i found the problem..

Conrad T. wrote:
> Hey Dominic, did you update your environment.rb to use rails 1.2.2
> instead of 1.1.6?  Also, you'll need to perform the following:
>
> rake rails:update
>
> -Conrad
This topic is locked and can not be replied to.