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 RequirementsController < ApplicationController | |
before_filter :load_project | |
def create | |
@requirement = @project.requirements.new(params[:requirement]) | |
if @requirement.save | |
redirect_to @project, :notice => "Requirement has been successfully added." | |
else | |
redirect_to @project, :alert => "Warning! This requirement was not saved." | |
end |
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
NoMethodError in Projects#show | |
Showing /Volumes/UserData/Users/jraczak/Desktop/nexus/app/views/requirements/new.html.erb where line #13 raised: | |
undefined method `include?' for nil:NilClass | |
Extracted source (around line #13): | |
10: <div class="field"> | |
11: <%= f.label "Requirement Type:" %></br> |
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
### ERROR OUTPUT ### | |
NoMethodError in Projects#show | |
Showing /Volumes/UserData/Users/jraczak/Desktop/nexus/app/views/requirements/_requirement.html.erb where line #5 raised: | |
undefined method `name' for nil:NilClass | |
Extracted source (around line #5): |
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
ArgumentError: wrong number of arguments (1 for 0) | |
from /Library/Ruby/Gems/1.8/gems/activerecord-3.2.1/lib/active_record/associations/collection_proxy.rb:90:in `tap' | |
from /Library/Ruby/Gems/1.8/gems/activerecord-3.2.1/lib/active_record/associations/collection_proxy.rb:90:in `send' | |
from /Library/Ruby/Gems/1.8/gems/activerecord-3.2.1/lib/active_record/associations/collection_proxy.rb:90:in `method_missing' | |
from (irb):1 |
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
<p id="notice"><%= notice %></p> | |
<p> | |
<b>Name:</b> | |
<%= @project.name %> | |
</p> | |
<p> | |
<b>Description:</b> | |
<%= @project.description %> |
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
def show | |
@project = Project.find(params[:id]) | |
@requirement = @project.requirements.build | |
respond_to do |format| | |
format.html # show.html.erb | |
format.json { render :json => @project } | |
end | |
end |
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
def requirements_approved | |
total = requirements.count | |
approved = requirements.where(approved: true).count | |
approved.to_f / total | |
end |
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
Can't connect to MySQL server on '/tmp/mysql.sock' (60) | |
Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql2", "database"=>"my_app_development", "host"=>"/tmp/mysql.sock", "pool"=>5, "password"=>nil}, charset: , collation: |
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
No route matches {:action=>"edit", :controller=>"requirements", :project_id=>#<Project id: 1, name: "Royal Caribbean 2.0", description: "Design, Development, Strategy, Full services", start_date: "2011-03-07", end_date: "2012-08-25", created_at: "2012-03-07 18:36:40", updated_at: "2012-03-07 18:36:40", user_id: 1>, :id=>nil} |
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
<p id="introduction">This is my introduction</p> | |
<p class="summary">I summarize the article here</p> | |
<p class="full-article">Here is my full article</p> |