Forum: Ruby on Rails Scaffolding to use has_many and belongs_to ?

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.
Adam D. (Guest)
on 2006-01-27 05:37
(Received via mailing list)
What does everyone on this list think about enhancing scaffolding
somehow so that  a "has_many" relationship will automatically drop the
<select> box into the view to reference the "belongs_to" part of the
view?

I think scaffolding is great but I am always adding the <select> boxes
to reference the parent association.  Do you think this would be
useful?  just a thought for enhancing an already powerful rails.

adam
Jeremy E. (Guest)
on 2006-01-27 06:56
(Received via mailing list)
On 1/26/06, Adam D. <removed_email_address@domain.invalid> wrote:
> What does everyone on this list think about enhancing scaffolding
> somehow so that  a "has_many" relationship will automatically drop the
> <select> box into the view to reference the "belongs_to" part of the
> view?
>
> I think scaffolding is great but I am always adding the <select> boxes
> to reference the parent association.  Do you think this would be
> useful?  just a thought for enhancing an already powerful rails.

See the Scaffolding Extensions plugin
(http://wiki.rubyonrails.com/rails/pages/Scaffoldin...).
zbyte pepsi-hola (Guest)
on 2006-01-27 08:38
(Received via mailing list)
very nice, but i can only get it through svn? :( would be nice to see a
gem
for this.
Adam D. (Guest)
on 2006-01-27 20:16
(Received via mailing list)
im a little confused.  The views are already created so where are
these magic select boxes supposed to be coming from?

adam
Jeremy E. (Guest)
on 2006-01-27 20:40
(Received via mailing list)
On 1/27/06, Adam D. <removed_email_address@domain.invalid> wrote:
> im a little confused.  The views are already created so where are
> these magic select boxes supposed to be coming from?

The Scaffolding Extensions plugin modifies the Rails scaffold method,
not the generator.  It's designed to replace the scaffold generator by
allowing for common customization requirements without the redundancy
implicit in code generation.  In other words, you don't generate the
scaffold and then modify it, instead you add the necessary
customization code to the model and then call the scaffold method in
the controller.
Adam D. (Guest)
on 2006-01-27 20:52
(Received via mailing list)
could you provide an example of calling one of these in the
controller?  I couldnt find an example in the docs.

thanks
adam
Jeremy E. (Guest)
on 2006-01-27 21:50
(Received via mailing list)
On 1/27/06, Adam D. <removed_email_address@domain.invalid> wrote:
> could you provide an example of calling one of these in the
> controller?  I couldnt find an example in the docs.

I'm not sure which docs you looked at.  See the wiki page
(http://wiki.rubyonrails.com/rails/pages/Scaffoldin...)
for explanations on usage.
This topic is locked and can not be replied to.