Skip to content

Instantly share code, notes, and snippets.

@xander-miller
Created November 15, 2014 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xander-miller/c6f75a9dda324847bcda to your computer and use it in GitHub Desktop.
Save xander-miller/c6f75a9dda324847bcda to your computer and use it in GitHub Desktop.
Untested example of post form in simple form
<%= simple_form_for [topic, post] do |f| %>
<%= f.input :title %>
<%= f.input :body, rows: 8 %>
<% if post.image? %>
<div class="form-group">
<p>Current image</p>
<%= image_tag( current_user.image.thumb.url ) %>
</div>
<% end %>
<%= f.input :image, as: :file %>
<%= f.hidden_field :image_cache %>
<%= f.button :submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment