# Repost - Can one edit the file that generates the scaffoldin

**URL:** <https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121>\
**Category:** Rails\
**Created:** [January 5, 2006, 10:39pm UTC](https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121 "2006-01-05T22:39:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brucebalmer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@brucebalmer](https://www.ruby-forum.com/u/brucebalmer)\
**Post date:** [January 5, 2006, 10:39pm UTC](https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121/1 "2006-01-05T22:39:48Z")

</div>

I am reposting this because not only am I VERY interested in the  
answer but because I think it would also be useful to many, many people.

We kind of have a house-style here, so it would be nice if the  
generated scaffold.css would accommodate that. My questions are?

Is it possible?

Is it safe?

How?

bruce

---

<div class="post-metadata">

**Author:** ![brucebalmer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@brucebalmer](https://www.ruby-forum.com/u/brucebalmer)\
**Post date:** [January 5, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121/2 "2006-01-05T23:44:28Z")

</div>

bruce balmer wrote:

> I am reposting this because not only am I VERY interested in the  
> answer but because I think it would also be useful to many, many people.
> 
> We kind of have a house-style here, so it would be nice if the  
> generated scaffold.css would accommodate that. My questions are?
> 
> Is it possible?
> 
> Is it safe?
> 
> How?
> 
> bruce

Yes, you can do it, but doing so will give you a non-standard rails  
install which will probably get tromped on by the next release.

A better solution would be to make your own generator for your own code  
and keep it separate from the rails version. I think there is some info  
about making new generators in the Rails Wiki.

---

<div class="post-metadata">

**Author:** ![brucebalmer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@brucebalmer](https://www.ruby-forum.com/u/brucebalmer)\
**Post date:** [January 5, 2006, 11:51pm UTC](https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121/3 "2006-01-05T23:51:55Z")

</div>

I think I understand what you’re asking. You want the generator to to  
use  
your styles for the scaffold.css. I would think by changing the:

ruby\lib\ruby\gems\1.8\gems\rails-  
1.0.0\lib\rails\_generator\generators\components\scaffold\templates\styles.css

file that’s what would get pulled down.

Michael T.

---

<div class="post-metadata">

**Author:** ![brucebalmer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@brucebalmer](https://www.ruby-forum.com/u/brucebalmer)\
**Post date:** [January 6, 2006, 12:37am UTC](https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121/4 "2006-01-06T00:37:00Z")

</div>

Kevin and Michael:

Thanks to both of you. What a great community. Nice to hang around  
people far ahead of me. I help others on the list where I can, to  
payback you guys for the help you give me.

Thanks again.

bruce

---

<div class="post-metadata">

**Author:** ![brucebalmer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@brucebalmer](https://www.ruby-forum.com/u/brucebalmer)\
**Post date:** [January 5, 2006, 11:51pm UTC](https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121/5 "2006-01-05T23:51:55Z")

</div>

Just tested it and sure enough it workies. I do not know if that’s how  
it  
should be done.

Michael T.

---

<div class="post-metadata">

**Author:** ![brucebalmer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@brucebalmer](https://www.ruby-forum.com/u/brucebalmer)\
**Post date:** [January 6, 2006, 12:49am UTC](https://www.ruby-forum.com/t/repost-can-one-edit-the-file-that-generates-the-scaffoldin/102121/6 "2006-01-06T00:49:04Z")

</div>

Michael T. wrote:

> I think I understand what you’re asking. You want the generator to to  
> use your styles for the scaffold.css. I would think by changing the:
> 
> ruby\lib\ruby\gems\1.8\gems\rails-1.0.0\lib\rails\_generator\generators\components\scaffold\templates\styles.css
> 
> file that’s what would get pulled down.  
> Am I not right in thinking that you could override that file alone in  
> the vendor/ directory? If you made a template scaffold file at  
> vendor/rails/railties/lib\rails\_generator\generators\components\scaffold\templates\styles.css

with nothing else in the path, wouldn’t that get used in preference to  
the one in the gems/ directory, allowing you to override it on an  
app-by-app basis?

Perhaps someone could try this - I’m away from my dev box at the moment.
