Permalink
Browse files

30737909-As a Dayhome, I need my photo caption over the photo, not th…

…e blurb
  • Loading branch information...
1 parent 35a0028 commit 08bea5486aac313881857a49524475f926533d43 @jonmholt jonmholt committed Jun 26, 2012
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -24,13 +24,16 @@ $iconSpritePath: asset-url("glyphicons-halflings.png", image) !default;
.field_with_errors input {
border: 1px solid #b94a48;
}
-
+.field_with_errors textarea {
+ border: 1px solid #b94a48;
+}
.field_with_errors {
display: inline;
}
-
+.field_with_errors label {
+ color: red;
+}
.field_with_errors label.message {
- display: inline;
margin-left: 5px;
}
@@ -27,7 +27,8 @@ class DayHome < ActiveRecord::Base
has_many :user_day_homes, :dependent => :destroy
has_many :users, :through => :user_day_homes
- validates :name, :street1, :city, :province, :postal_code, :slug, :email, :phone_number, :presence => true
+ validates :name, :street1, :city, :province, :postal_code, :slug, :email, :phone_number, :highlight, :presence => true
+ validates :highlight,:length => { :maximum => 200 }
validates_associated :photos
validates_uniqueness_of :slug, :email
@@ -12,6 +12,7 @@
= form_for [:admin, @day_home], :html => {:multipart => true} do |f|
+
= f.label :name
= f.text_field :name
@@ -27,12 +28,13 @@
= f.label :email
= f.text_field :email
- = f.label :blurb
- = f.text_area :blurb
-
= f.label :highlight
= f.text_area :highlight
+ = f.label :blurb
+ = f.text_area :blurb
+
+
= f.label :featured, :class => 'checkbox' do
= f.check_box :featured
Feature on homepage?
@@ -6,9 +6,9 @@
# Uncomment the following block if you want each input field to have the validation messages attached.
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
unless html_tag =~ /^<label/
- %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
- else
%{<div class="field_with_errors">#{html_tag}</div>}.html_safe
+ else
+ %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
end
end
@@ -1,5 +1,5 @@
class AddHighlightBlurbToDayHomes < ActiveRecord::Migration
def change
- add_column :day_homes, :highlight, :text
+ add_column :day_homes, :highlight, :string
end
end
View
@@ -115,7 +115,7 @@
t.string "phone_number"
t.text "blurb"
t.boolean "licensed", :default => false, :null => false
- t.text "highlight"
+ t.string "highlight"
end
create_table "events", :force => true do |t|

0 comments on commit 08bea54

Please sign in to comment.