Skip to content

Instantly share code, notes, and snippets.

@CADBOT
Last active August 29, 2015 14:01
Show Gist options
  • Save CADBOT/e631c4a95c08192627fb to your computer and use it in GitHub Desktop.
Save CADBOT/e631c4a95c08192627fb to your computer and use it in GitHub Desktop.
<h2>New project</h2>
<%= form_for(@project) do |f| %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :technologies_used %><br />
<%= f.text_area :technologies_used %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
<%= link_to 'Back', projects_path %>
class ProjectsController < ApplicationController
def index
@projects = Project.all
end
def new
@project = Project.create
end
end
Rails.application.routes.draw do
resources :projects
end
<h2>New project</h2>
<form accept-charset="UTF-8" action="/projects/2" class="edit_project" id="edit_project_2" method="post"><div style="display:none"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="patch" /><input name="authenticity_token" type="hidden" value="Z313Tcw5crF9IKH/seZFCVdYB3BkoUPlOn3qtfo62vA=" /></div>
<div class="field">
<label for="project_name">Name</label><br />
<input id="project_name" name="project[name]" type="text" />
</div>
<div class="field">
<label for="project_technologies_used">Technologies used</label><br />
<textarea id="project_technologies_used" name="project[technologies_used]">
</textarea>
</div>
<div class="actions">
<input name="commit" type="submit" value="Update Project" />
</div>
</form>
<a href="/projects">Back</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment