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
#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 | |
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
= form_for @bottles do |f| | |
- if @bottles.errors.any? | |
#error_explanation | |
%h2= "#{pluralize(@bottles.errors.count, "error")} prohibited this wine from being saved:" | |
%ul | |
- @bottles.errors.full_messages.each do |msg| | |
%li= msg | |
.field | |
= f.label :name, autofocus: true |