History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-608
Type: Sub-task Sub-task
Status: Open Open
Priority: Critical Critical
Assignee: Graeme Rocher
Reporter: Seymour Cakes
Votes: 7
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Grails
GRAILS-3412

Refactored scaffolding to make create and edit gsp files refer to external form template.

Created: 16/Jan/07 10:40 AM   Updated: 19/Sep/08 04:21 AM
Component/s: Scaffolding
Affects Version/s: 0.4, 0.3.1
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments: 1. File patch_17012007 (6 kb)

Issue Links:
Related
 

Testcase included: yes


 Description  « Hide
Refactored the scaffolding code to render the form to a _form.gsp file and have both create.gsp and edit.gsp refer to the same form.

So now create.gsp and edit.gsp will have there <g:render template="form" ... /> tag to render the form instead of producing a html form for each of the file.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Graeme Rocher - 22/May/07 05:48 AM
The _form.gsp template is missing from this patch. Can't apply.

Benjamin Klum - 12/Feb/08 07:51 AM
This is a good suggestion, however it would be even better if the set of scaffold-able GSPs wouldn't be limited to "list.gsp", "show.gsp", "create.gsp" and "edit.gsp".

As a result, we would be able to customize the scaffolding templates more fine-grained and elegantly using view templates. Also, no changes to the Grails source code would be necessary to apply the behaviour suggested in this issue. It would be only a matter of changing scaffolding templates ("edit.gsp", "create.gsp") and adding new ones ("_form.gsp").


Marcel Overdijk - 12/Feb/08 08:17 AM
+1 for Benjamin Klum

However, I think the idea is already on the roadmap indicated by 'Refactor scaffolding to make it more pluggable and extensible '


Tyler Williams - 10/Jun/08 05:46 PM
This JIRA (http://jira.codehaus.org/browse/GRAILS-2906) has a patched file that addresses Ben's suggestion.

If people are brave, they can do the following (it sounds worse than it is).

1) Download grails source
2) Get the patched file from the JIRA listed (tested w/1.0.2)
2a) If you are using 1.0.3 and package names for your domain objects you need to merge the file
3) Compile the grails-crud jar from the source
4) Run grails install-templates
5) Add/remove/rename any of the gsp files in the {PROJECT_DIR}\src\templates\scaffolding directory
6) The generate-views script will now pick up and use the new set of gsps

OR for 1.0.2 users only

1) Grab the jar attached to the JIRA and put it in {GRAILS_HOME}/src
2) Run grails install-templates
3) Add/remove/rename any of the gsp files in the {PROJECT_DIR}\src\templates\scaffolding directory
4) The generate-views script will now pick up and use the new set of gsps


Tyler Williams - 10/Jun/08 07:08 PM
Sorry that should have been {GRAILS_HOME}/dist