title: Moving Grails logic from view to controller
body: <p>This question is a continuation of the question <a href="https://stackoverflow.com/questions/7069323/grails-gselect-woes">here</a>.</p>
  
  <p>The code below is from one of my views and it works fine, but I am having difficulty moving this code to a controller.  If my packages and classes are not clear from the code below, look at the previous question to see how they are arranged.</p>
  
  <pre><code>&lt;g:set var="roleAdmin" value='${org.me.example.userrole.Role.findByAuthority("ROLE_ADMIN")}' /&gt;
  &lt;g:set var="roleOfficeProfessional" value='${org.me.example.userrole.Role.findByAuthority("ROLE_OFFICE_PROFESSIONAL")}' /&gt;
  &lt;g:set var="roleDriver" value='${org.me.example.userrole.Role.findByAuthority("ROLE_DRIVER")}' /&gt;
  &lt;g:select name="loggedBy.id" from="${org.me.example.userrole.UserRole.findAllByRoleInList([roleAdmin, roleOfficeProfessional, roleDriver]).user}" optionKey="id" value="${loadInstance?.loggedBy?.id}"  /&gt;   
  </code></pre>
  
  <p>It may be a basic misunderstanding on my part, but I cannot get ANY of the methods that I have made in my controllers to work in my views, only the methods that Grails has created (i.e. <code>list</code>, <code>create</code>, <code>delete</code>, <code>edit</code>, etc.) will work.  Any assistance / recommendations would be helpful.</p>