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
# if you create subfolders inside assets/images you will need to add them to the path | |
# just put this code inside application.rb | |
Dir.glob("#{Rails.root}/app/assets/images/**/").each do |path| | |
config.assets.paths << path | |
end | |
# thanks to @depa at http://stackoverflow.com/questions/21502608/rails-4-asset-pipeline-image-subdirectories |
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
/* Solution to make a responsive background full image | |
courtesy of http://sixrevisions.com/css/responsive-background-image/ */ | |
body { | |
/* Location of the image */ | |
background-image: url("Concierge.jpg"); | |
/* Background image is centered vertically and horizontally at all times */ | |
background-position: center center; | |
/* Background image doesn't tile */ |
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
#problem: validate field2 and field3 depending on value of field1 | |
validates :field1, presence: true | |
validates :field2, presence: true, :if => Proc.new {|o| o.field1 == "Yes" } | |
validates :field3, presence: true, :if => Proc.new {|p| p.field1 == "No" } |