Created
November 17, 2011 10:11
-
-
Save mericano1/1372844 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void save(Long id /*, Shop shop*/) { | |
Shop byId = Shop.findById(id); | |
// set owner manually (dont edit from FE) | |
User user = User.find("byEmail", Security.connected()).first(); | |
byId.owner = user; | |
Binder.bind(byId, "shop", request.params); | |
// Validate | |
validation.valid(byId); | |
if (validation.hasErrors()) | |
render("@form", byId); | |
byId.save(); | |
index(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment