helzer
December 1, 2007, 2:41am
1
I’m trying to migrate to Rails 2, but keep getting these errors all
over the place:
ActionView::TemplateError: wrong number of arguments (2 for 3)
On line #61 of users/new.rhtml
58: <% if @captcha_error -%><div class="fieldWithErrors"><
% end -%>
59:
60: Verification
code:
61: <%= image_tag
@captcha_image.public_filename , :size=>@captcha_image.image_size %></
td>
62:
63: Enter code:
64: <%= text_field_tag :code %>
vendor/rails/actionpack/lib/action_view/helpers/
asset_tag_helper.rb:350:in compute_public_path' vendor/rails/actionpack/lib/action_view/helpers/ asset_tag_helper.rb:350:in
path_to_image’
vendor/rails/actionpack/lib/action_view/helpers/
asset_tag_helper.rb:390:in image_tag' app/views/users/new.rhtml:61:in
_run_rhtml_47app47views47users47new46rhtml’
vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:
224:in fields_for' vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb: 184:in
form_for’
…
Basically, every function that calls `compute_public_path’ gets this
error. In this case, it’s ‘image_tag’.
I’m looking at the source and don’t see any problem.
def image_path(source)
compute_public_path(source, 'images')
end
def compute_public_path(source, dir, ext = nil, include_host =
true)
compute_public_path takes a minimus of one parameter, which is
supplied by image_path.
What am I doing wrong here?
Thanks,
Helzer
helzer
December 1, 2007, 3:14am
2
On 11/30/07, helzer [email protected] wrote:
I’m trying to migrate to Rails 2, but keep getting these errors all
over the place:
ActionView::TemplateError: wrong number of arguments (2 for 3)
You probably have a plugin, like asset_packager, overriding tag_options.
jeremy
helzer
December 1, 2007, 3:14am
3
On 11/30/07, Jeremy K. [email protected] wrote:
On 11/30/07, helzer [email protected] wrote:
I’m trying to migrate to Rails 2, but keep getting these errors all
over the place:
ActionView::TemplateError: wrong number of arguments (2 for 3)
You probably have a plugin, like asset_packager, overriding tag_options.
Or image_path…
jeremy
helzer
December 1, 2007, 3:39am
4
Nice catch Jeremy,
I’ll patch asset_packager for Rails 2.
Amir