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
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
#include <DHT.h> | |
#include <DHT_U.h> | |
#include <Adafruit_Sensor.h> | |
#include "DHT.h" |
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
<%= form_for(@system) do |f| %> | |
... | |
<%= f.fields_for :system_components_attributes do |p| %> | |
<%= p.collection_select(:component_id, Component.all, :id, :name, {prompt: :true, include_hidden: false}, {:multiple => true}) %><br> | |
<% 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
require 'ruby_nlp/ngram' | |
class Corpus | |
def initialize(glob, klass) | |
@glob = glob | |
@klass = klass | |
end | |
def files | |
@files ||= Dir[@glob].map do |file| |
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
<%= form_for(@projection) do |f| %> | |
<% if @projection.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@projection.errors.count, "error") %> prohibited this projection from being saved:</h2> | |
<ul> | |
<% @projection.errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> |
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
undefined local variable or method `survey_questions_attributes' for #<SurveysController:0x007fd175e9c098> |
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 Projection < ActiveRecord::Base | |
has_many :income_projections | |
has_many :incomes, :through => :income_projections | |
accepts_nested_attributes_for :income_projections | |
def update(post_params) | |
... |
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
def new | |
@location = Location.all | |
@item = Item.new | |
respond_to do |format| | |
format.html # new.html.erb | |
format.json { render json: @item } | |
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
class Task < ActiveRecord::Base | |
belongs_to :project | |
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
Processing by ProjectionsController#update as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"OtMaPeeiYzRVjXgSbTs4Jp/uNl5oAzfHCdQm/72y6eY=", "projection"=>{"name"=>"6 months", "incomes_attributes"=>{"0"=>{"name"=>"cool", "amount"=>"32323"}}}, "commit"=>"Update Projection", "id"=>"1"} | |
Projection Load (0.1ms) SELECT "projections".* FROM "projections" WHERE "projections"."id" = ? LIMIT 1 [["id", 1]] |
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
def projection_params | |
params.require(:projection).permit(:name, | |
incomes_attributes: [:id, :name, :amount, :projection_id] | |
) | |
end |