Created
January 11, 2010 17:38
-
-
Save stevenharman/274415 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 class MyViewModel | |
{ | |
// other crap... | |
public string to_metadata() | |
{ | |
var jq_meta = new | |
{ | |
required = IsRequired, | |
messages = new { required = "gimme one, yo!"} | |
}; | |
return new JQueryMeta().Serialize(jq_meta); | |
} | |
} |
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
<!-- usage: --> | |
<input type="text" class="<%= model.to_metadata() %>" value="<%= model.value " /> | |
<!-- renders: --> | |
<input type="text" class="{required:true, messages:{ required:'gimme one, yo!' }}" value="<%= model.value " /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment