# 'Admin::UsersHelper' is already used problem

**URL:** <https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384>\
**Category:** Rails\
**Created:** [October 7, 2008, 11:51pm UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384 "2008-10-07T23:51:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 7, 2008, 11:51pm UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/1 "2008-10-07T23:51:56Z")

</div>

Hi,

I’m getting the next error:

The name ‘Admin::UsersHelper’ is either already used in your application  
or reserved by Ruby on Rails.

When trying to run:  
ruby script/generate controller Admin::Users

I’ve done something similar with Rails 2.0 with no problems. I have  
Rails 2.1.1 now.

Tried to google but found no hints. Just that I’m not the only one with  
similar problem.

Any ideas how to fix it?

Thanks

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 3:14am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/2 "2008-10-08T03:14:15Z")

</div>

i had the same problem. i am not sure what is causeing the error. what  
i did was use a name different than users. i used  
Admin::AccountsHelper which worked fine.

On Oct 7, 5:51 pm, comopasta Gr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 3:52am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/3 "2008-10-08T03:52:23Z")

</div>

On Oct 8, 5:51 am, comopasta Gr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’ve done something similar with Rails 2.0 with no problems. I have  
> Rails 2.1.1 now.
> 
> Tried to google but found no hints. Just that I’m not the only one with  
> similar problem.
> 
> Any ideas how to fix it?
> 
> ## Thanks
> 
> Posted viahttp://www.ruby-forum.com/.

Try using:

script/generate controller admin/users

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 7:38am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/4 "2008-10-08T07:38:49Z")

</div>

Do you happen to have a model named Admin?

On Tue, Oct 7, 2008 at 6:51 PM, Erol F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > ## When trying to run: Thanks
> > 
> > Posted viahttp://www.ruby-forum.com/.
> 
> Try using:
> 
> script/generate controller admin/users
> 
> >

–  
Robby R.  
Chief Evangelist, Partner

PLANET ARGON, LLC  
design // development // hosting

> **[Planet Argon](https://www.planetargon.com/)**
>
> Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.

[http://www.robbyonrails.com/](http://www.robbyonrails.com/)  
aim: planetargon

+1 503 445 2457  
+1 877 55 ARGON [toll free]  
+1 815 642 4068 [fax]

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 8:03am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/5 "2008-10-08T08:03:59Z")

</div>

On Oct 8, 1:37 pm, “Robby R.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Do you happen to have a model named Admin?

Nvm what I just said earlier. It’s a confirmed bug:

[http://rails.lighthouseapp.com/projects/8994/tickets/545](http://rails.lighthouseapp.com/projects/8994/tickets/545)

One way I found around it is to temporarily rename the helper with the  
same name on the parent namespace before running the script/generate.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 8:23am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/6 "2008-10-08T08:23:42Z")

</div>

Hi,

Thanks for the replies.

> One way I found around it is to temporarily rename the helper with the  
> same name on the parent namespace before running the script/generate.

Erol how did you actually renamed it? I tried and complains about some  
dependencies.

C:\InstantRails\rails\_apps\test\>ruby script/generate scaffold Problem  
bug:string  
exists app/models/  
exists app/controllers/  
exists app/helpers/  
create app/views/problems  
exists app/views/layouts/  
exists test/functional/  
exists test/unit/  
exists public/stylesheets/  
create app/views/problems/index.html.erb  
create app/views/problems/show.html.erb  
create app/views/problems/new.html.erb  
create app/views/problems/edit.html.erb  
create app/views/layouts/problems.html.erb  
create public/stylesheets/scaffold.css  
create app/controllers/problems\_controller.rb  
create test/functional/problems\_controller\_test.rb  
create app/helpers/problems\_helper.rb  
route map.resources :problems  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
create app/models/problem.rb  
create test/unit/problem\_test.rb  
create test/fixtures/problems.yml  
create db/migrate  
create db/migrate/20081008061905\_create\_problems.rb

C:\InstantRails\rails\_apps\test\>ruby script/generate controller  
Admin::Problems  
The name ‘Admin::ProblemsHelper’ is either already used in your  
application or reserved by Ruby on Rails.  
Please choose an alternative and run this generator again.

* * *

How would you remane the helper in the above test?

Thanks!

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 8:39am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/7 "2008-10-08T08:39:09Z")

</div>

On Oct 8, 2:23 pm, comopasta Gr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> C:\InstantRails\rails\_apps\test\>ruby script/generate scaffold Problem  
> create app/views/problems/show.html.erb  
> exists test/unit/  
> application or reserved by Ruby on Rails.  
> Please choose an alternative and run this generator again.
> 
> * * *
> 
> How would you remane the helper in the above test?
> 
> Thanks!
> 
> –  
> Posted viahttp://www.ruby-forum.com/.

I’m assuming you already have non-namespaced ProblemsController - and  
corresponding ProblemsHelper.

Rename problems\_helper.rb to problems\_helper.rb.bak in your app/  
helpers directory.  
Run your generate script.  
Rename problems\_helper.rb.bak to its original name.

HTH

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 8:20am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/8 "2008-10-08T08:20:26Z")

</div>

Erol F. wrote:

> On Oct 8, 1:37?pm, “Robby R.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Do you happen to have a model named Admin?
> 
> Nvm what I just said earlier. It’s a confirmed bug:
> 
> [#545 Bug colliding classes (when they shouldn't) - Ruby on Rails - rails](http://rails.lighthouseapp.com/projects/8994/tickets/545)
> 
> One way I found around it is to temporarily rename the helper with the  
> same name on the parent namespace before running the script/generate.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 8, 2008, 9:30am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/9 "2008-10-08T09:30:46Z")

</div>

> Rename problems\_helper.rb to problems\_helper.rb.bak in your app/  
> helpers directory.  
> Run your generate script.  
> Rename problems\_helper.rb.bak to its original name.

Yeah, now it went through.

Thanks!

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [December 8, 2008, 2:54am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/10 "2008-12-08T02:54:29Z")

</div>

I had the same problem setting up my categories, so I wiped them out and  
then scaffolded the admin before the frontend app and it worked  
perfectly.

ruby script/generate scaffold Admin::Categories name:string  
parent\_id:integer lft:integer rgt:integer

ruby script/generate scaffold Categories name:string parent\_id:integer  
lft:integer rgt:integer

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [October 23, 2008, 4:03pm UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/11 "2008-10-23T16:03:03Z")

</div>

in application.rb

comment “helper :all” and run again.  
Like this:

class ApplicationController \< ActionController::Base  
#helper :all # include all helpers, all the time  
end

On 10e$B7ne(B8e$BF|e(B, e$B\>e8ae(B5e$B;~e(B51e$BJ,e(B, comopasta Gr  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [December 8, 2008, 3:14am UTC](https://www.ruby-forum.com/t/admin-usershelper-is-already-used-problem/150384/12 "2008-12-08T03:14:39Z")

</div>

Update… not so perfectly at first…

1. It was Category not Categories

ruby script/generate scaffold Admin::Category name:string  
parent\_id:integer lft:integer rgt:integer

ruby script/generate scaffold Category name:string parent\_id:integer  
lft:integer rgt:integer

1. I had to go into the admin controller and views and remove Admin::  
and admin\_ from everywhere but the controller class declaration.

2. Also… I think I’m gonna delete the generated Admin::Category class.

I have to wonder if there’s not a better way… oh well, newbie must  
learn.

Dave Furf wrote:

> I had the same problem setting up my categories, so I wiped them out and  
> then scaffolded the admin before the frontend app and it worked  
> perfectly.
> 
> ruby script/generate scaffold Admin::Categories name:string  
> parent\_id:integer lft:integer rgt:integer
> 
> ruby script/generate scaffold Categories name:string parent\_id:integer  
> lft:integer rgt:integer
