This file contains hidden or 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
First, here's the full error I'm getting when I try to load the /tasks page: | |
NoMethodError in Tasks#index | |
Showing C:/Sites/task_mgr/app/views/tasks/index.html.erb where line #8 raised: | |
undefined method `name' for nil:NilClass | |
Extracted source (around line #8): | |
5: <li> |
This file contains hidden or 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
<%= form_for(@task) do |f| %> | |
<%= f.label :content, "Task" %> | |
<%= f.text_field :content%> | |
<br> | |
<%= f.label :due_date %> | |
<%= f.date_select :due_date %> | |
<br> | |
<br> | |
<% if current_page?(new_task_path) %> | |
<%= f.submit "Create Task", class: "btn btn-large btn-primary" %> |
This file contains hidden or 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 | |
before_filter :authorize, :except => [:new] | |
def index | |
@companies = Company.all | |
end | |
def new | |
@company = Company.new | |
@company.users.build |
This file contains hidden or 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 | |
before_filter :authorize | |
def index | |
@tasks = Task.all | |
@users = User.all | |
end | |
def new | |
@task = Task.new |
NewerOlder