Forum: Ruby on Rails scaffold not working like i hoped......

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.
3c4ba12064907d6669de548a7affaf1d?d=identicon&s=25 SpudNerd (Guest)
on 2008-11-08 20:57
(Received via mailing list)
Hi:

i've tried this on three macs (tiger, panther, etc).. and my ROR is up
to date on each.


My models and controllers aren't displaying all my mysql db fields.

When I run script/generate scaffold Planner ... it builds the
controller, model, and all the rest.

When I go to test the app and new controller, now called planners no
content is listed... and all I ever get is the submit button, and
'SHOW', 'EDIT' links.  I get none of the form to work with, just the
form button.

I noticed that the Views for the controller planners has all
*.html.erb  extensions.... .i changed them to .rhtml extensions, but
nothing changes.

Nothing is visible.... tested in FF, safari....

Any suggestions?

Spud
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-11-08 20:58
(Received via mailing list)
On Nov 8, 7:18 pm, SpudNerd <nerdc...@gmail.com> wrote:
> Hi:
>
> i've tried this on three macs (tiger, panther, etc).. and my ROR is up
> to date on each.
>
> My models and controllers aren't displaying all my mysql db fields.
>

That's just the way scaffolding is. I think the old  pre 2.x
scaffolding is available  as a plugin somewhere.

Fred
3c4ba12064907d6669de548a7affaf1d?d=identicon&s=25 Chris Ripley (Guest)
on 2008-11-08 22:28
(Received via mailing list)
the more i'm reading here... it looks like scaffold is not built in....
even
though going the generate does create the views, just not a complete
CRUD.
I don't really care about the CRUD.. just the rapid generation of views.

Spud

On Sat, Nov 8, 2008 at 11:57 AM, Frederick Cheung <
Af2ce6689213fdb78913a9662b18da6b?d=identicon&s=25 Rick (Guest)
on 2008-11-09 20:49
(Received via mailing list)
Did you run rake db:migrate?

Rick
3c4ba12064907d6669de548a7affaf1d?d=identicon&s=25 Chris Ripley (Guest)
on 2008-11-09 23:28
(Received via mailing list)
Yes.. i've run rake db:migrate.
D6434aa0b7b350f8c3ed0119d81b2ead?d=identicon&s=25 Roy Pardee (rpardee)
on 2008-11-10 18:57
(Received via mailing list)
Scaffolding is still built-in, but it won't look for existing tables
when it builds the views.  You've got to list out all your
column_name:column_type pairs on the call to script/generate.

It's a bummer, but there it is...

________________________________
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Chris Ripley
Sent: Sunday, November 09, 2008 2:28 PM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Re: scaffold not working like i hoped......

Yes.. i've run rake db:migrate.

On Sun, Nov 9, 2008 at 11:48 AM, Rick
<Richard.T.Lloyd@gmail.com<mailto:Richard.T.Lloyd@gmail.com>> wrote:

Did you run rake db:migrate?

Rick
134ea397777886d6f0aa992672a50eaa?d=identicon&s=25 Mark Thomas (Guest)
on 2008-11-10 22:55
(Received via mailing list)
Try Ryan Bates' nifty_generators gem.

I haven't tried it yet (on my todo list) but supposedly it can
generate controller and views by looking at the attributes of an
existing model. See
http://github.com/ryanb/nifty-generators/tree/mast...

-- Mark.
3c4ba12064907d6669de548a7affaf1d?d=identicon&s=25 Chris Ripley (Guest)
on 2008-11-11 04:31
(Received via mailing list)
Yes... cool.  I did a little digging and found out 'how' to do it now.
Truthfully, I like the old way for rapid CRUD of existing data (for
internal
apps and those not necessarily for primetime); but noobs can't always
get
what they want -- usually something easy.

I'm definitely a noob.

But thanks all for the good advice.

Spud
6ef8cb7cd7cd58077f0b57e4fa49a969?d=identicon&s=25 Brian Hogan (Guest)
on 2008-11-11 15:06
(Received via mailing list)
If you

gem install scaffold_form_generator

you'll get the part that makes new and edit forms. I extracted this from
Rails 1.x and made it work for  current Rails cos while I hate
scaffolding,
I hate making forms by hand even more.

Docs are at http://scaffoldform.rubyforge.org/
This topic is locked and can not be replied to.