Forum: Ruby on Rails repost - Can one edit the file that generates the scaffoldin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bruce B. (Guest)
on 2006-01-05 23:39
(Received via mailing list)
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
Kevin O. (Guest)
on 2006-01-06 00:44
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.
Michael T. (Guest)
on 2006-01-06 00:51
(Received via mailing list)
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.
Michael T. (Guest)
on 2006-01-06 00:51
(Received via mailing list)
Just tested it and sure enough it workies.  I do not know if that's how
it
should be done.

Michael T.
Bruce B. (Guest)
on 2006-01-06 01:37
(Received via mailing list)
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
Alex Y. (Guest)
on 2006-01-06 01:49
(Received via mailing list)
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.
This topic is locked and can not be replied to.