Skip to content

Instantly share code, notes, and snippets.

View mpron's full-sized avatar

Mitch Pronschinske mpron

View GitHub Profile
= form_for @bottles do |f|
- if @bottles.errors.any?
%h2= "#{pluralize(@bottles.errors.count, "error")} prohibited this wine from being saved:"
- @bottles.errors.full_messages.each do |msg|
%li= msg
= f.label :name, autofocus: true
#This is Rails 4.0.2 so the attr_accessible functionality is handled in the controller
class Bottle < ActiveRecord::Base
belongs_to :wine
belongs_to :user
belongs_to :location