Forum: Ruby on Rails Advice needed on tracking down unusual error

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.
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-04-06 15:08
Does anyone have advice on how to go about locating the cause of this
error message:

ActionView::TemplateError (wrong number of arguments (3 for 1)) on line
#4 of app/views/products/search.rhtml:
4: <%= start_form_tag :action => 'search' %>

I don't see anything wrong with line 4 above.

Some background: I've made a number of changes to Controllers, Layouts,
Views and Models in my app so it is going to be very difficult to back
track and find where the app started to fail. I've a feeling this error
is possibly caused by bad formating in my code somewhere. Given this,
what is the best approach to finding the bug?

thanks
-Lindsay
4daf0b71d5d9a3882e583c0e72eaf5dc?d=identicon&s=25 Alan Francis (Guest)
on 2006-04-06 15:15
Lindsay Boyd wrote:
> Does anyone have advice on how to go about locating the cause of this
> error message:
>
> ActionView::TemplateError (wrong number of arguments (3 for 1)) on line
> #4 of app/views/products/search.rhtml:
> 4: <%= start_form_tag :action => 'search' %>
>
> I don't see anything wrong with line 4 above.

I'd:

1) look at the HTML source generated if you take the line out, see if
you can spot anything weird

2) try :url => { :action => 'search' }, just in case.

Alan
4daf0b71d5d9a3882e583c0e72eaf5dc?d=identicon&s=25 Alan Francis (Guest)
on 2006-04-06 15:16
Alan Francis wrote:
> Lindsay Boyd wrote:
>> Does anyone have advice on how to go about locating the cause of this
>> error message:
>>
>> ActionView::TemplateError (wrong number of arguments (3 for 1)) on line
>> #4 of app/views/products/search.rhtml:
>> 4: <%= start_form_tag :action => 'search' %>
>>
>> I don't see anything wrong with line 4 above.
>
> I'd:
>
> 1) look at the HTML source generated if you take the line out, see if
> you can spot anything weird
>
> 2) try :url => { :action => 'search' }, just in case.
>
> Alan

By take the line out, I actually mean replace it with a literal <form
method="post" action="/controller/search">

:-)

Alan
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-04-06 15:24
Alan Francis wrote:
>replace it with a literal <form method="post" action="/controller/search">

Thanks for the advice, Alan. I tried that and now I have:

ActionView::TemplateError (wrong number of arguments (2 for 1)) on line
#13 of app/views/products/search.rhtml:
10: <center>
11:     <p><label for="search">UPC/Tag</label>
12:     <%= text_field 'search', 'search', :size => '30', :maxsize =>
'41' %>
13:     <%= submit_tag 'search' %>

So looks like something is badly screwed up!

-Lindsay
B26c571d17b3022ab1a98c1a223c32e6?d=identicon&s=25 David Thomson (Guest)
on 2006-04-06 15:26
(Received via mailing list)
Should line 12 be:

<%= text_field 'search', 'search', { :size => '30', :maxsize => '41' }
%>

?

HTH
David
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-04-06 15:31
David Thomson wrote:
> Should line 12 be:
>
> <%= text_field 'search', 'search', { :size => '30', :maxsize => '41' }
> %>
>
> ?
>
> HTH
> David

Yes, you're right - options in {}, but that isn't causing this error.
It's as though I've somehow broken the form methods for my app.

- Lindsay
A77873df3a9766b208e009248a2a9a56?d=identicon&s=25 Hampton (Guest)
on 2006-04-06 15:33
(Received via mailing list)
I don't think anything is badly screwed up.

I have a theory that there is an unclosed erb line above.

Some <%= that never hits a %>... or some <%= function('stuff' %> who
never
hits a parenthesis.

Just a theory.

-hampton catlin.
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-04-06 15:37
Alan Francis wrote:

>> 2) try :url => { :action => 'search' }, just in case.

Tried this, but still get the same error.

-Lindsay
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-04-06 15:38
Hampton wrote:
> I don't think anything is badly screwed up.
>
> I have a theory that there is an unclosed erb line above.
>
> Some <%= that never hits a %>... or some <%= function('stuff' %> who
> never
> hits a parenthesis.
>
> Just a theory.
>
> -hampton catlin.

I think you are right. Is there an easy way to locate this, or do I need
to step through the code by hand?

-Lindsay
Ae03102311939454d2b7f1ca3139fd97?d=identicon&s=25 Lindsay Boyd (Guest)
on 2006-04-06 15:44
>Is there an easy way to locate this

I've just a grepped | wc -l on the ERB tags: 902 open, 901 closed, so I
guess I have to find the extra or missing tag!

-Lindsay
A77873df3a9766b208e009248a2a9a56?d=identicon&s=25 Hampton (Guest)
on 2006-04-06 15:51
(Received via mailing list)
Ouch! But good work with the unix command!

I would say that, knowing processors, it probably is just north of where
you
are getting that error.

-hampton.
This topic is locked and can not be replied to.