title: grails : how to pass params in remoteFunction
body: <p>I want to a param using remoteFunction of grails. </p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code> &lt;table class="table table-hover table-bordered" id="profittable"&gt;
                          &lt;thead&gt;
                              &lt;tr&gt;
                                &lt;th&gt;Date&lt;/th&gt;
                                &lt;th&gt;Profit&lt;/th&gt;
                                &lt;th&gt;Delete?&lt;/th&gt;
                              &lt;/tr&gt;
                          &lt;/thead&gt;
                          &lt;tbody&gt; 
  
                  &lt;g:each in="${dailyProfit}" var="dp"&gt;
                      &lt;tr onclick="&lt;g:remoteFunction action='edit' params="[date:${dp.date}]"&gt;&lt;/g:remoteFunction&gt;" &gt;
                          &lt;td&gt;&lt;g:formatDate format="yyyy-MM-dd" date="${dp.date}"/&gt;&lt;/td&gt;
                          &lt;td&gt;
                                                      &lt;g:formatNumber number="${dp.profit}" type="currency" currencyCode="PHP" format="###.##" /&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;g:form controller="dailyProfit" action="delete" &gt;
                                                          &lt;g:hiddenField name="date" value="${dp.date.format("yyyy-MM-dd")}" /&gt;
                                                          &lt;g:actionSubmit class="delete" value="Delete" &gt;
                                                              &lt;span class="glyphicon glyphicon-trash" aria-hidden="true"&gt;&lt;/span&gt;
                                                          &lt;/g:actionSubmit&gt;    
                                                      &lt;/g:form&gt;
                                                  &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/g:each&gt;
                          &lt;/tbody&gt;
                      &lt;/table&gt;
  </code></pre>
  
  <p><strong>ERROR MESSAGE</strong></p>
  
  <blockquote>
    <p>URI /SampleGrailsApp/dailyProfit/index Class
    org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException
    Message Attribute value quote wasn't closed (action='edit'
    params="[date:${dp.date}]").</p>
  </blockquote>
  
  <p><strong>ACTIONS FOR EDIT</strong></p>
  
  <p>The remoteFunction tag is inside every tr of my table. The plan is, if the row is clicked, the edit page will appear</p>
  
  <pre><code>def edit() {
      DateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
      Date date = format.parse(params.date);
      def dailyProfit = DailyProfit.findByDate(date)
      render view:"edit" , model:[dailyProfit : dailyProfit]
  }
  
   def update() {
      DateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
      Date date = format.parse(params.date);
      def dailyProfit = DailyProfit.findByDate(date)
      if(dailyProfit){
          dailyProfit.properties = params
          dailyProfit.save(flush:true)
      }
      list() 
  }
  </code></pre>
  
  <p>What is the proper way of passing parameters using remoteFunction tag of grails?</p>