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
<h1>Add New Company</h1> | |
<%= form_for(@company) do |f| %> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
<%= f.label :address %> | |
<%= f.text_field :address %> | |
<%= f.nested_fields_for :phone_numbers do |f| | |
render 'phone', f: f |
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
d |
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
class TasksController < ApplicationController | |
def index | |
end | |
def show | |
end | |
def new |
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
resources :companies do | |
resource :tasks | |
resources :contacts do | |
end | |
end |
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
resources :companies do | |
resource :tasks | |
resources :contacts do | |
end | |
end | |
resources :contacts do | |
resources :tasks | |
end |
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
# == Schema Information | |
# | |
# Table name: contacts | |
# | |
# id :integer not null, primary key | |
# first_name :text | |
# last_name :text | |
# email :text | |
# bcard :text | |
# linked_in :text |
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
class CompaniesController < ApplicationController | |
def index | |
@companies = Company.paginate(page: params[:page]) | |
@due_today = Task.where(:due_date => Time.now.beginning_of_day..Time.now.end_of_day) | |
# @disable_nav = true to stop a partial from displaying in a certain page using unless in application.html.erb | |
end |
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
class CompaniesController < ApplicationController | |
def index | |
@companies = Company.paginate(page: params[:page]) | |
@due_today = Task.where(:due_date => Time.now.beginning_of_day..Time.now.end_of_day) | |
# @disable_nav = true to stop a partial from displaying in a certain page using unless in application.html.erb | |
end |
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
<% for task in current_task %> | |
<% if task.due_date.to_date == DateTime.now.to_date %> | |
<strong>Today</strong> | |
<%= task.description %> | |
<% elsif task.due_date.to_date == (DateTime.now + 1.day).to_date %> | |
<strong>Tomorrow</strong> | |
<%= task.description %> | |
<% end %> | |
<% end %> |
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
<% for task in current_task %> | |
<% if task.due_date.to_date == DateTime.now.to_date %> | |
<strong>Today</strong> | |
<%= task.description %> | |
<% elsif task.due_date.to_date == (DateTime.now + 1.day).to_date %> | |
<strong>Tomorrow</strong> | |
<%= task.description %> | |
<% end %> | |
<% end %> |
OlderNewer