Skip to content

Instantly share code, notes, and snippets.

workouts
________
id
date
reps
desc
exercise_id
exercise
________
mysql> create table workouts
-> (
-> id INT NOT NULL AUTO_INCREMENT,
-> PRIMARY KEY (id),
-> date DATETIME NOT NULL,
-> reps INT NOT NULL,
-> notes VARCHAR(200)
-> );
CREATE TABLE `accounts` (
`account_id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(30) NOT NULL,
`balance` decimal(9,2) DEFAULT NULL,
PRIMARY KEY (`account_id`)
)
CREATE TABLE `transactions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL,
class Project < ActiveRecord::Base
attr_accessible :description, :name
has_many :user_projects
has_many :users, :through => :user_projects
end
NoMethodError in FeedsController#index
undefined method `feed_read' for #<ActiveRecord::Relation:0x007fc784132d58>
Rails.root: /Users/telagraphic/Documents/programming/rails_projects/codebase
Application Trace | Framework Trace | Full Trace
app/controllers/feeds_controller.rb:7:in `index'
def feed_me(source, subtopic)
@feed = current_user.feeds.build(model_id: source.id, model_name: source.class.to_s, subtopic_id: subtopic.id)
@feed.save
end
<%= form_for @project do |f| %>
<%= f.label :name %>
<br>
<%= f.text_field :name %>
<br>
<%= f.label :description %>
<br>
<%= f.text_field :description%>
<br>
before_filter :correct_user, only: :show
def correct_user
@account = Account.find_by_id(params[:id])
redirect_to root_url unless correct_user?(@account.user_id)
end
ActiveRecord::RecordInvalid in PaymentsController#create
Validation failed: Amount is not a number
Rails.root: /Users/telagraphic/Documents/programming/rails_projects/life-ulator
Application Trace | Framework Trace | Full Trace
app/controllers/payments_controller.rb:8:in `block in create'
app/controllers/payments_controller.rb:7:in `create'
ActiveRecord::RecordInvalid in PaymentsController#create
Validation failed: Amount is not a number
Rails.root: /Users/telagraphic/Documents/programming/rails_projects/life-ulator
Application Trace | Framework Trace | Full Trace
app/models/payment.rb:9:in `save_and_update'
app/controllers/payments_controller.rb:8:in `create'
Request