What is the point of the template scaffold in the lib directory?

7 views
Skip to first unread message

rosco

unread,
Jul 28, 2011, 4:17:39 AM7/28/11
to SimpleForm
Can anyone shed light on this for me?

How do you use it?

Does it have any use?

Have I missed the point!

Rosco

Rafael Mendonça França

unread,
Jul 28, 2011, 8:34:05 AM7/28/11
to plataformate...@googlegroups.com

Christopher Biltoft

unread,
Jul 28, 2011, 6:59:19 PM7/28/11
to plataformate...@googlegroups.com
Many thanks Rafael.

~ Ross

Christopher Biltoft

unread,
Jul 28, 2011, 10:23:21 PM7/28/11
to SimpleForm
Hi Rafael

Thanks again.

I have played with it in an erb environment 3.0+ & it's great.

Trying to make the template work in a haml environment for 3.1.

I see the template created in a haml sub-directory of templates

Is there a haml equivalent for the template?

~ Ross

Rafael Mendonça França

unread,
Jul 29, 2011, 2:12:25 PM7/29/11
to plataformate...@googlegroups.com
Sorry but I didn't understand.

Could you explain better what you are trying to do?

rosco

unread,
Jul 30, 2011, 6:46:00 AM7/30/11
to SimpleForm
Yes.

I have worked out the issue.

Background: the scaffold has been run for the first time - migration
is created & form built properly.
Scenario: for whatever reason, I re-run the scaffold, to, amongst
other things, re-generate the form.

I used the command: rails g scaffold Participant --migration false -s

which skips existing files and creates the rest except for the
migration, in this case.

The form generated looks like this:

------------------------------------------------------------
= simple_form_for(@participantb) do |f|
= f.error_notification

.inputs

.actions
= f.button :submit
--------------------------------------------------------------

Through testing, this scenario won't re-gen the form. It would seem
that the form is generated of the field specs contained on the
scaffold command line, not read from the database after the table has
been built - which doesn't seem ideal.

But now I know!

Thanks for your help.
~ Ross



On Jul 30, 4:12 am, Rafael Mendonça França <rafaelmfra...@gmail.com>
wrote:
> Sorry but I didn't understand.
>
> Could you explain better what you are trying to do?  
>
> --  
> Rafael Mendonça Françahttp://twitter.com/rafaelfrancahttps://github.com/rafaelfranca
> Sent with Sparrow (http://www.sparrowmailapp.com)
Reply all
Reply to author
Forward
0 new messages