Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Would just creating a new controller method (not index) for the purpose of just updating industry work? The follow will work when passed the s.id and the s.industry to be added (or if exists replaced if that's what you're looking to do).</p> <p>In your view: (send the view the s object but it seems like you do that now) (also, I'm using the groovy template helper, you can use the html if you want, same results)</p> <pre><code>#{a @Stocks.index(s.id, s.industry=roeBean.industry) } Add This Industry {/a} </code></pre> <p>In your controller: (Replace String with whatever Industry is)</p> <pre><code>public static void addIndustry(Long id, String industry) { Stock s = Search.findById(id); String i = industry; //Do your stuff s.save(); } </code></pre> <p>Passing a static string here (or other stuff) works too. so s.industry='test' will GET id=1 and industry=test in this example.</p> <p>If you want your links to have all properties of an object, can you not just send the whole object? Passing the entire key/value bit of every property in an object seems like a lot of work if you just want the entire object? So in this example:</p> <p>when you render the view from your controller</p> <pre><code>render(s); </code></pre> <p>the link?</p> <pre><code>#{a @Stocks.index(s, s.industry=roeBean.industry) } Add This Industry {/a} </code></pre> <p>In your controller to save:</p> <pre><code>public static void addIndustry(Stock s, String industry) { //Do your stuff s.save(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload