Acts_as_taggable Plugin issue (not gem)

I tried to post this earlier, but it never came through. I’ve got
something working in console, but not in controller. Any idea why?

This is the plugin not the gem of acts_as_taggable


Listing elements

<% if @elements.blank? %>

There are currently no elements in the system tagged <%=
“"#{params[:tag_name]}"” %>.

<% else %>

Currently tracking <%= @elements.size %> elements in the system
tagged <%= “"#{params[:tag_name]}"” %>.

	<%= render :partial => 'element', :collection => @elements %>

<% end %>

<%= link_to ‘New element’, new_element_path %>

This returns that the array is empty and there’s nothing in the tag in

SO teh view is seeing it, but the controller is not getting it. Because
in the console, using a string in place of params(:tag_name) returns an
actual entry.


def tagged # This should take the :tag_name in the url string and pull elements that match # It does not. I suck as a programmer. @elements = Element.find_tagged_with(params[:tag_name])
respond_to do |format|
  format.html # index.rhtml
  format.xml  { render :xml => @elements.to_xml }



class Element < ActiveRecord::Base



This does work:

soho:~/Sites/work/koji jathayde$ script/console
Loading development environment.

@elements = Element.find_tagged_with(“spam”)
DEPRECATION WARNING: The :dependent => true option is deprecated and
will be removed from Rails 2.0. Please use :dependent => :destroy
instead. See for details. See for details. (called from
has_many at
=> [#<Element:0x330a8d8 @attributes={“name”=>“Koji Test One”,
“updated_at”=>“2006-11-30 18:16:40”, “id”=>“1”, “description”=>“supa
sexy description”, “filename”=>nil, “element_type_id”=>“3”,

But this does not (because there is no value in params[:tag_list]:

@elements = Element.find_tagged_with(params[:tag_list])
NameError: undefined local variable or method `params’ for
from (irb):4
from :0