Ignore:
Timestamp:
Mar 10, 2010, 2:40:58 PM (10 years ago)
Author:
keesvb
Message:

Cleaned up BootStrap? (removed accidental multiple addition of eventGroup in PPSH study), cleaned up scaffolded classes in root package, removed obsolete BaseController?, added some code to Sandbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/SandboxController.groovy

    r247 r253  
    1313                // Get the example study in a lazy way
    1414                def st = Study.get(1)
    15                 def f = st.template.subjectFields
    16 
    17                 //println st.giveAllFields()
     15                def fieldsAll = st.giveSubjectTemplates().fields
     16        def f = fieldsAll[0]
     17        println fieldsAll.class
     18            println f.class
     19      f.each {
     20        println "" + it + "-" + it.class
     21      }
     22      //println st.giveAllFields()
    1823
    1924                // This is a way to iterate over the fields in your controller
     
    2126                // Most of the time, you would just iterate over them in the view using <g:each>
    2227                // See also views/sandbox/index.gsp
    23                 f.each {field ->
     28                f.each { field ->
    2429                        println field.name + "(" + field.type + ")"
    2530                }
     
    4247
    4348                // Specify which variables we want to be available in the controller (implicit return statement)
    44                 [fields: f, subjects: st.subjects]
     49                [fields: f, subjects: st.subjects, studyInstance: st]
    4550        }
    4651}
Note: See TracChangeset for help on using the changeset viewer.