Open GoogleCodeExporter opened 9 years ago
Proposed implementation:
/**
* Renders results with a template.
*
* This call must be the last call in the action.
*
@param template - template name, can be "list" - for a view whose name is different than the name of this action, or
* "/another_controller/any_view" - this is a reference to a view from another controller. The format of this
* parameter should be either a single word or words separated by slash: '/'. If this is a single word, than
* it is assumed that template belongs to current controller, if there is a slash used as a separator, then the
* first word is assumed to be a name of another controller.
* @param values map with values to pass to view.
* @return instance of {@link RenderBuilder}, which is used to provide additional parameters.
*/
@Override
protected RenderBuilder render(String template, Map values) {
String targetTemplate = template.startsWith("/")? template: Router.getControllerPath(getClass())
+ "/" + template;
return super.render(targetTemplate, values);
}
Original comment by ipolevoy@gmail.com
on 12 Aug 2011 at 1:53
Original issue reported on code.google.com by
kamilsk...@gmail.com
on 8 Aug 2011 at 6:42