summaryrefslogtreecommitdiff
path: root/app/views/tutorials
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-09-10 19:58:57 -0600
committermo k <mo@mokhan.ca>2012-09-10 19:58:57 -0600
commitda802e736bfad87e05d4b05e05ee4f0c780eb0c2 (patch)
tree168ee483495b69d0a5906220fb396687e7bb6ad7 /app/views/tutorials
parent0844c47d1104e874bab6d2a64d17573b25e2052d (diff)
tidy up the new tutorial form.
Diffstat (limited to 'app/views/tutorials')
-rw-r--r--app/views/tutorials/_form.html.erb51
-rw-r--r--app/views/tutorials/new.html.erb14
2 files changed, 33 insertions, 32 deletions
diff --git a/app/views/tutorials/_form.html.erb b/app/views/tutorials/_form.html.erb
index 91884d64..723bc908 100644
--- a/app/views/tutorials/_form.html.erb
+++ b/app/views/tutorials/_form.html.erb
@@ -1,29 +1,26 @@
-<%= form_for(@tutorial) do |f| %>
- <% if @tutorial.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@tutorial.errors.count, "error") %> prohibited this tutorial from being saved:</h2>
-
- <ul>
- <% @tutorial.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
+<%= form_for(@tutorial, :html => {:class => "form-horizontal"}) do |f| %>
+ <fieldset>
+ <div class="control-group">
+ <%= f.label :heading, :class => "control-label" %>
+ <div class="controls">
+ <%= f.text_field :heading, :class => "input-xlarge" %>
+ </div>
</div>
- <% end %>
-
- <div class="field">
- <%= f.label :heading %><br />
- <%= f.text_field :heading %>
- </div>
- <div class="field">
- <%= f.label :description %><br />
- <%= f.text_area :description %>
- </div>
- <div class="field">
- <%= f.label :url %><br />
- <%= f.text_field :url %>
- </div>
- <div class="actions">
- <%= f.submit %>
- </div>
+ <div class="control-group">
+ <%= f.label :url, :class => "control-label" %>
+ <div class="controls">
+ <%= f.text_field :url, :class => "input-xlarge" %>
+ </div>
+ </div>
+ <div class="control-group">
+ <%= f.label :description, :class => "control-label" %>
+ <div class="controls">
+ <%= f.text_area :description, :class => "input-xlarge" %>
+ </div>
+ </div>
+ <div class="form-actions">
+ <button type="submit" class="btn btn-primary">Save changes</button>
+ <a href="<%= url_for tutorials_url %>" class="btn">Cancel</a>
+ </div>
+ </fieldset>
<% end %>
diff --git a/app/views/tutorials/new.html.erb b/app/views/tutorials/new.html.erb
index 9f75b4be..f1d1345b 100644
--- a/app/views/tutorials/new.html.erb
+++ b/app/views/tutorials/new.html.erb
@@ -1,5 +1,9 @@
-<h1>New tutorial</h1>
-
-<%= render 'form' %>
-
-<%= link_to 'Back', tutorials_path %>
+<% provide(:title, "Share a tutorial") -%>
+<div class="page-header">
+ <h1>Share a new tutorial</h1>
+</div>
+<div class="row">
+ <div class="span12">
+ <%= render 'form' %>
+ </div>
+</div>