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:
<tbody>
<%= render :partial => ''admin/products/product'',
:collection =>
@collection %>
</tbody>
view parital
_product
1: <tr id="<%= dom_id(product) %>" class="<%=
cycle(''odd'', ''even'') %>">
ERROR HERE> 2: <td><%= image_tag( product.cover(:thumb_50), :class
=>
''image'' ) if product.cover(:thumb_50) %></td>
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: <thead>
8: <tr>
9: <th width="30"> </th>
10:>>> <th width="auto"
class="orderable"><%link_to_orderable("Name",
"name") %></th>
11: <th width="80">Products</th>
12: <th width="70"
class="orderable"><%link_to_orderable("Created",
"created_at") %></th>
13: <th width="70"
class="orderable"><%link_to_orderable("Updated",
"updated_at") %></th>
---
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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---