Advice needed on tracking down unusual error


#1

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


#2

Lindsay B. 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


#3

Alan F. wrote:

replace it with a literal

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:
11:

UPC/Tag
12: <%= text_field ‘search’, ‘search’, :size => ‘30’, :maxsize =>
‘41’ %>
13: <%= submit_tag ‘search’ %>

So looks like something is badly screwed up!

-Lindsay


#4

Alan F. wrote:

Lindsay B. 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

:slight_smile:

Alan


#5

Should line 12 be:

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

?

HTH
David


#6

David T. 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

#7

Alan F. wrote:

  1. try :url => { :action => ‘search’ }, just in case.

Tried this, but still get the same error.

-Lindsay


#8

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


#9

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.


#10

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.


#11

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