-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate example HTML. Somewhat of a hack, but there may be an easier…
… way to render a template outside of Rails.
- Loading branch information
Showing
3 changed files
with
107 additions
and
9 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html> | ||
<head> | ||
<title> | ||
Good Form Example | ||
</title> | ||
<link href='../generators/good_form_builder/templates/good_form.css' media='screen' rel='stylesheet' type='text/css' /> | ||
<style> | ||
body { font-family: sans-serif; margin: 2em; } | ||
h1 { margin-bottom: 0.5em; } | ||
</style> | ||
</head> | ||
<body> | ||
<h1> | ||
Good Form Example | ||
</h1> | ||
<form> | ||
<fieldset> | ||
<legend> | ||
Your Info, Please | ||
</legend> | ||
<label class="field" for="model_stub_title">Title<input id="model_stub_title" name="model_stub[title]" size="30" type="text" value="" /></label> | ||
<label class="field-first" for="model_stub_author">Author<input id="model_stub_author" name="model_stub[author]" size="30" type="text" value="" /></label> | ||
<label class="field-last" for="model_stub_department">Department<input id="model_stub_department" name="model_stub[department]" size="30" type="text" value="" /></label> | ||
</fieldset> | ||
<fieldset> | ||
<input id="model_stub_submit" name="commit" type="submit" value="Save" /> | ||
</fieldset> | ||
</form> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
!!! Strict | ||
%html | ||
%head | ||
%title | ||
Good Form Example | ||
|
||
%link{:href => "../generators/good_form_builder/templates/good_form.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/ | ||
|
||
%style | ||
body { font-family: sans-serif; margin: 2em; } | ||
h1 { margin-bottom: 0.5em; } | ||
|
||
%body | ||
|
||
%h1 | ||
Good Form Example | ||
|
||
-# HACK Use Haml form since output_buffer isn't working | ||
%form | ||
-form_for(ModelStub.new, :builder => GoodFormBuilder) do |f| | ||
%fieldset | ||
-# TODO Get output_buffer and concat working so fieldset helper can be used. | ||
%legend | ||
Your Info, Please | ||
|
||
=f.text_field 'title' | ||
|
||
=f.text_field 'author', :label => "Author", :class => "field-first" | ||
=f.text_field 'department', :class => "field-last" | ||
|
||
%fieldset | ||
=f.submit "Save" |