# Odd problem with templates

**URL:** <https://www.ruby-forum.com/t/odd-problem-with-templates/171953>\
**Category:** Rails\
**Created:** [July 12, 2009, 8:39am UTC](https://www.ruby-forum.com/t/odd-problem-with-templates/171953 "2009-07-12T08:39:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [July 12, 2009, 8:39am UTC](https://www.ruby-forum.com/t/odd-problem-with-templates/171953/1 "2009-07-12T08:39:34Z")

</div>

I’m having a strange problem with templates and I’d like to know if  
anyone else is having the same experience.

The classic plugin which is used as an example for plugin installation  
and generator running is restful-authentication. So I assume that has  
been well tested. But whenever I run it the generator only does part  
of the job as compared with what it would do if I ran it from the  
command line. It creates the user.rb or account.rb (depending on your  
requirements), but it’s not generating the migration for users or  
accounts (depending on requirements), nor is it adding the resource  
routes.

After I’ve run the template I can run the generator from the command  
line and it does the job properly. So I can’t see what’s going on  
here.

By mucking about with various methods of running the generator in the  
template either generate(etc) or run(‘script/generate etc’) or using  
backticks I did once get the thing to generate the migrations, though  
it missed out the routes. Now I can’t step back to where it did that  
and it’s now just creating the controllers and models but missing out  
the routes and migrations.

I’m mystified. The obvious workaround is to run the generators from  
the command line after the template, but somehow this isn’t what you  
should have to do.

Anyone else having this problem?

Ta

John S.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [July 12, 2009, 11:48am UTC](https://www.ruby-forum.com/t/odd-problem-with-templates/171953/2 "2009-07-12T11:48:13Z")

</div>

Hello John,

How about showing us your template? I’ve used template to drive  
restful-authentication and finished the template with a “rake  
db:migrate” to create the necessary tables. As r-a has many options,  
perhaps it would be helpful if you post your template.
