Skip to content

Instantly share code, notes, and snippets.

@biographie
Created July 18, 2013 16:35
Show Gist options
  • Save biographie/6030803 to your computer and use it in GitHub Desktop.
Save biographie/6030803 to your computer and use it in GitHub Desktop.
<div class="container">
<div class="content pull-left">
<%= form_for(@task, :url => {:action => "create"}) do |f| %>
<%= f.label :description %>
<%= f.text_field :description, :class => "input-width bottom-border" %>
<%= f.label :task_category_id, "Choose a category" %>
<%= f.collection_select(:task_category_id, TaskCategory.all, :id, :task_category) %>
<%= f.label :due_date %>
<%= f.select :due_date, ['Today', 'Tomorrow', 'Next Week']%>
<%= f.submit "Add this Task", class: "btn" %>
<% end %>
</div>
</div>
# == Schema Information
#
# Table name: tasks
#
# id :integer not null, primary key
# title :text
# task_category_id :integer
# due_date :datetime
# description :text
# completed_at :datetime
# company_id :integer
# contact_id :integer
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Task < ActiveRecord::Base
attr_accessible :company_id, :completed_at, :contact_id, :description, :due_date, :task_category_id, :title, :user_id
belongs_to :company
belongs_to :task_category
belongs_to :contact
belongs_to :user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment