[Rails] scaffold_path
Micah Calabrese
micahphone at gmail.com
Tue Nov 23 19:30:08 GMT 2004
Maybe try changing the scaffold_path on the application controller.
http://www.rubyonrails.org/show/AbstractApplicationController
Micah Calabrese
On Tue, 23 Nov 2004 12:45:29 +0000, Sean O'Halpin
<seanonrails at hotmail.com> wrote:
> Thanks Sascha - I should have been clearer as to what exactly I was looking
> for.
>
> I was wondering if there were an ~easy~ way to override scaffold_path
> without
> having to change library code or override the whole definition of scaffold.
> Because the scaffold method adds these methods dynamically to the
> controller, you can't
> simply override only the scaffold_path method anywhere (it seems)
> as the act of adding the scaffold will redefine whatever method
> you put in place (it does a module_eval inside your controller).
>
> So it appears that the only way to change the default scaffold_path is to
> either:
>
> 1) redefine the library definition (which will change the default path for
> the whole installation!),
> 2) change it on a controller by controller basis by redefining the
> scaffold_path after calling scaffold, e.g.
>
> scaffold :post
> def scaffold_path "/web/app/scaffold/templates" end
>
> or
> 3) override the whole scaffold definition
>
> I'll probably go for 3).
>
> I was just wondering if there were an easier way I was missing.
>
> Regards,
>
> Sean O'Halpin
>
> _________________________________________________________________
> Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo
>
>
>
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
More information about the Rails
mailing list