Commit 8c65cdc8 authored by John Noel's avatar John Noel

Optimization #1 - Partials

parent 83eeba1b
<%= simple_form_for post do |f| %>
<%= f.input :title %>
<%= f.input :content %>
<%= f.button :submit, "Post", class: "btn btn-primary" %>
<%= link_to "Back", posts_path, class: "btn btn-default" %>
<% end %>
\ No newline at end of file
<h1>Edit Post</h1> <h1>Edit Post</h1>
<%= simple_form_for @post do |f| %> <%= render partial: 'form', locals: { post: @post } %>
<%= f.input :title %> \ No newline at end of file
<%= f.input :content %>
<%= f.button :submit, "Post", class: "btn btn-primary" %>
<%= link_to "Back", posts_path, class: "btn btn-default" %>
<% end %>
\ No newline at end of file
<h1>New Post</h1> <h1>New Post</h1>
<%= simple_form_for @post do |f| %> <%= render partial: 'form', locals: { post: @post } %>
<%= f.input :title %> \ No newline at end of file
<%= f.input :content %>
<%= f.button :submit, "Post", class: "btn btn-primary" %>
<%= link_to "Back", posts_path, class: "btn btn-default" %>
<% end %>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment