Skip to content

Instantly share code, notes, and snippets.

@rehanift
Created March 1, 2012 23:48
Show Gist options
  • Save rehanift/1954089 to your computer and use it in GitHub Desktop.
Save rehanift/1954089 to your computer and use it in GitHub Desktop.
SML Stories Application Example
{% contest name:"stories-example" %}
{% partial name:"entry-form" %}
{% contest_form %}
<div>
<label>
Name:
<input type="text" name="registration[name]"/>
</label>
</div>
<div>
<label>
Story:
<textarea name="submission[story]"></textarea>
</label>
</div>
<input type="submit" />
{% endcontest_form %}
{% endpartial %}
{% partial name:"success-view" %}
Thank you for your submission!
{% endpartial %}
{% contest_form_link entry_form_partial:"entry-form" success_partial:"success-view" %}
Share your story
{% endcontest_form_link %}
<h3>Other user stories</h3>
{% for entry in contest.contest_entries %}
<p>{{ entry.registration.name }} said {{ entry.submission.story }}</p>
{% endfor %}
{% endcontest %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment