# Undefined method \`request' for "products":String?

**URL:** <https://www.ruby-forum.com/t/undefined-method-request-for-products-string/115095>\
**Category:** Rails\
**Created:** [September 20, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/undefined-method-request-for-products-string/115095 "2007-09-20T15:46:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adammontgomery](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Post date:** [September 20, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/undefined-method-request-for-products-string/115095/1 "2007-09-20T15:46:19Z")

</div>

Since updated edge yesturday i have had a series of errors related to  
undefinded methods for “products”:String.

I do have these controllers namespaced.

====  
Errors example 1:  
undefined method `request’ for “products”:String  
Extracted source (around line #2):

view:

  
\<%= render :partial =\> ‘admin/products/product’, :collection =\>  
@collection %\>  

view parital  
\_product

1:

  
ERROR HERE\> 2: \<%= image\_tag( product.cover(:thumb\_50), :class =\>  
‘image’ ) if product.cover(:thumb\_50) %\>

model:  
class Product …  
.  
.  
def cover(size)  
assets.blank? ? nil : assets.first.public\_filename(size)  
end

===  
Errors example 2:  
undefined method `url\_for’ for “categories”:String  
Extracted source (around line #10):

7:   
8:   
9: &nbsp;  
10:\>\>\> \<%=  
link\_to\_orderable(“Name”, “name”) %\>  
11: Products  
12: \<%=  
link\_to\_orderable(“Created”, “created\_at”) %\>  
13: \<%=  
link\_to\_orderable(“Updated”, “updated\_at”) %\>

* * *

vendor/rails/actionpack/lib/action\_view/helpers/url\_helper.rb:70:in  
`send' vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:70:in`url\_for’  
vendor/rails/actionpack/lib/action\_view/helpers/url\_helper.rb:136:in  
`link_to' app/helpers/admin/base_helper.rb:19:in`link\_to\_orderable’  
app/views/admin/categories/index.html.erb:10:in  
`_run_erb_47app47views47admin47categories47index46html46erb' app/controllers/admin/base_controller.rb:25:in`index’  
app/controllers/admin/base\_controller.rb:24:in `index’

* * *

helper

def link\_to\_orderable(name, order, default = false)

```
case params[:order]
  when default && nil
    className = "ordered_desc"

  when order
    className = "ordered"
    order = "#{order} desc"

  when "#{order} desc"
    className = "ordered_desc"
end

options = params.merge(:order => order, :page => nil )

```

> > link\_to(name, options, :class =\> className)  
> > end

Seems that link\_to uses url\_for

---

<div class="post-metadata">

**Author:** ![adammontgomery](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Post date:** [September 21, 2007, 12:18pm UTC](https://www.ruby-forum.com/t/undefined-method-request-for-products-string/115095/2 "2007-09-21T12:18:34Z")

</div>

Ok so i made a SMRT error the night before.

I created, as a test, an attribute called @controller in my  
base\_controller (from which all controllers inherit function).

This causes the errors.

Case closed, i have a bad memory.
