Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Wikis Form
<%= form_for(@wiki) do |f| %>
<% if @wiki.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@wiki.errors.count, "error") %> prohibited this wiki from being saved:</h2>
<ul>
<% @wiki.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br>
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :body %><br>
<%= f.text_area :body %>
</div>
<% if current_user.role?("premium") %>
<div class="field">
<%= f.check_box :private %>
<%= f.label :private, "Private?" %><br>
</div>
<% end %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment