Created
November 15, 2014 03:18
-
-
Save xander-miller/c6f75a9dda324847bcda to your computer and use it in GitHub Desktop.
Untested example of post form in simple form
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
<%= 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