# Acts\_as\_taggable issue

**URL:** <https://www.ruby-forum.com/t/acts-as-taggable-issue/80461>\
**Category:** Rails\
**Created:** [December 27, 2006, 5:05am UTC](https://www.ruby-forum.com/t/acts-as-taggable-issue/80461 "2006-12-27T05:05:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![boboroshi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@boboroshi](https://www.ruby-forum.com/u/boboroshi)\
**Post date:** [December 27, 2006, 5:05am UTC](https://www.ruby-forum.com/t/acts-as-taggable-issue/80461/1 "2006-12-27T05:05:21Z")

</div>

This won’t post with a full code paste, so I’ve got to link it to  
another forum where I’ve posted it.

> **[RailsNotes — The Ruby on Rails guides you wished you had.](https://railsnotes.xyz/)**
>
> RailsNotes 🟥 is a collection of the Ruby on Rails guides you wished you had, when you were first starting out. We have interesting Ruby on Rails articles for topics like Hotwire, Stimulus, ActionMailer, Databases, Deployment and more. Whether you're...

Can’t get the acts\_as\_taggable plugin to play nice. Works in console,  
not in teh view.

---

<div class="post-metadata">

**Author:** ![boboroshi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@boboroshi](https://www.ruby-forum.com/u/boboroshi)\
**Post date:** [December 27, 2006, 6:19pm UTC](https://www.ruby-forum.com/t/acts-as-taggable-issue/80461/2 "2006-12-27T18:19:04Z")

</div>

On Dec 26, 2006, at 11:03 PM, boboroshi wrote:

> This won’t post with a full code paste, so I’ve got to link it to  
> another forum where I’ve posted it.
> 
> [http://www.railsweenie.com/forums/1/topics/1053](http://www.railsweenie.com/forums/1/topics/1053)
> 
> Can’t get the acts\_as\_taggable plugin to play nice. Works in console,  
> not in teh view.

You’re not showing your routes.rb, so I can’t be sure, but it looks  
like you need to setup a route for this…

= in config/routes.rb

map.connect ‘/elements/tagged/:tag\_name’, :controller =\>  
‘elements’, :action =\> ‘tagged’

= end

Alternatively, you could use params[:id] instead of params[:tag\_name]  
in line 4 of your controller, but changing the route will make it  
clearer that you’re not expecting a numeric id there.

-JD Harrington

---

<div class="post-metadata">

**Author:** ![boboroshi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@boboroshi](https://www.ruby-forum.com/u/boboroshi)\
**Post date:** [December 27, 2006, 6:41pm UTC](https://www.ruby-forum.com/t/acts-as-taggable-issue/80461/3 "2006-12-27T18:41:12Z")

</div>

Thanks JD. I actually do have this, but I don’t call the controller

map.connect ‘:controller/tagged/:tag\_name’, :action =\> :tagged

Also, this could cause a lot of issue - I’m using RC1 for 1.2 and  
everything is restful.

So in trying to go for semantic urls, is

[http://tld.com/elements/tagged/tag\_name](http://tld.com/elements/tagged/tag_name)

not a good way to go? Here is the full routes file with all comments  
removed:

ActionController::Routing::Routes.draw do |map|  
map.resources :element\_types  
map.resources :elements

map.connect ‘:controller/tagged/:tag\_name’, :action =\> :tagged

map.connect ‘’, :controller =\> “element”

map.connect ‘:controller/service.wsdl’, :action =\> ‘wsdl’

map.connect ‘:controller/:action/:id.:format’  
map.connect ‘:controller/:action/:id’  
end

I appreciate the help,  
John

---

<div class="post-metadata">

**Author:** ![boboroshi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@boboroshi](https://www.ruby-forum.com/u/boboroshi)\
**Post date:** [December 27, 2006, 6:47pm UTC](https://www.ruby-forum.com/t/acts-as-taggable-issue/80461/4 "2006-12-27T18:47:12Z")

</div>

AH! using the symbol for :tagged in the routes breaks it. Not sure why.  
But it does. Changing the route to

map.connect ‘:controller/tagged/:tag\_name’, :action =\> ‘tagged’

made it work

---

<div class="post-metadata">

**Author:** ![boboroshi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@boboroshi](https://www.ruby-forum.com/u/boboroshi)\
**Post date:** [December 27, 2006, 6:51pm UTC](https://www.ruby-forum.com/t/acts-as-taggable-issue/80461/5 "2006-12-27T18:51:14Z")

</div>

On Dec 27, 2006, at 12:45 PM, boboroshi wrote:

> AH! using the symbol for :tagged in the routes breaks it. Not sure  
> why.  
> But it does. Changing the route to
> 
> map.connect ‘:controller/tagged/:tag\_name’, :action =\> ‘tagged’
> 
> made it work

Interesting. Glad it’s working for you now.

-JD
