Permalink
Browse files

added explicite precompile css files

  • Loading branch information...
1 parent 23b1bae commit 17f312a7b3d85cb9f5b35e0b366790d3c6e3aaee @BrianMehrman committed Dec 12, 2011
@@ -0,0 +1,3 @@
+body {
+ background-color: #00f;
+}
@@ -0,0 +1,3 @@
+body {
+ background-color: #f00;
+}
Binary file not shown.
Binary file not shown.
@@ -15,7 +15,8 @@ def detect_browser
@browser = nil
end
end
-
+
+ # user filters
def sign_user_in(user)
session[:user_id] = user.id
end
@@ -47,4 +48,33 @@ def require_user
redirect_to landing_path, :notice => "You must be logged in to see this page."
end
end
+
+ # tracking filters
+ def user_trackings
+ if @user
+ @trackings = @user.trackings
+ else
+ @trackings = []
+ end
+ end
+
+ # food filters
+ def user_generated_food
+ end
+
+ def user_generated_nutrition
+
+ end
+
+ # meal filters
+ def user_meals
+
+ end
+
+ # track filters
+ def available_tracks
+
+ end
+
+
end
@@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base
before_filter :detect_browser
def detect_browser
- require "browser"
+ #require "browser"
user_agent = request.env['HTTP_USER_AGENT'].downcase
if user_agent
@@ -15,7 +15,8 @@ class ApplicationController < ActionController::Base
@browser = nil
end
end
-
+
+ # user filters
def sign_user_in(user)
session[:user_id] = user.id
end
@@ -47,4 +48,33 @@ class ApplicationController < ActionController::Base
redirect_to landing_path, :notice => "You must be logged in to see this page."
end
end
+
+ # tracking filters
+ def user_trackings
+ if @user
+ @trackings = @ser.trackings
+ else
+ @trackings = []
+ end
+ end
+
+ # food filters
+ def user_generated_food
+ end
+
+ def user_generated_nutrition
+
+ end
+
+ # meal filters
+ def user_meals
+
+ end
+
+ # track filters
+ def available_tracks
+
+ end
+
+
end
@@ -1,7 +1,7 @@
class UsersController < ApplicationController
before_filter :require_user, :only =>[:index, :show, :edit]
-
+ before_filter :user_trackings, :only => [:show]
# GET /users
# GET /users.json
def index
@@ -0,0 +1,87 @@
+class UsersController < ApplicationController
+
+ before_filter :require_user, :only =>[:index, :show, :edit]
+
+ # GET /users
+ # GET /users.json
+ def index
+ @users = User.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @users }
+ end
+ end
+
+ # GET /users/1
+ # GET /users/1.json
+ def show
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @user }
+ end
+ end
+
+ # GET /users/new
+ # GET /users/new.json
+ def new
+ @user = User.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @user }
+ end
+ end
+
+ # GET /users/1/edit
+ def edit
+ @user = User.find(params[:id])
+ end
+
+ # POST /users
+ # POST /users.json
+ def create
+ @user = User.new(params[:user])
+
+ respond_to do |format|
+ if @user.save
+ session[:user_id] = @user.id
+ UserMailer.welcome_email(@user).deliver
+ format.html { redirect_to @user, notice: 'User was successfully created.' }
+ format.json { render json: @user, status: :created, location: @user }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @user.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /users/1
+ # PUT /users/1.json
+ def update
+ @user = User.find(params[:id])
+
+ respond_to do |format|
+ if @user.update_attributes(params[:user])
+ format.html { redirect_to @user, notice: 'User was successfully updated.' }
+ format.json { head :ok }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @user.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /users/1
+ # DELETE /users/1.json
+ def destroy
+ @user = User.find(params[:id])
+ @user.destroy
+
+ respond_to do |format|
+ format.html { redirect_to users_url }
+ format.json { head :ok }
+ end
+ end
+end
@@ -1,2 +1,4 @@
class Tracking < ActiveRecord::Base
+ belongs_to :user
+ belongs_to :track
end
@@ -0,0 +1,2 @@
+class Tracking < ActiveRecord::Base
+end
View
@@ -7,8 +7,8 @@ class User < ActiveRecord::Base
validates_uniqueness_of :email
validates_presence_of :email
-
def foods
FoodDes.where(["\"user_id\" = ?", self.id])
end
+
end
View
@@ -1,11 +1,13 @@
class User < ActiveRecord::Base
has_secure_password
has_many :meals
+ has_many :trackings
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :on => :create
validates_uniqueness_of :email
validates_presence_of :email
+
def foods
FoodDes.where(["\"user_id\" = ?", self.id])
end
Binary file not shown.
@@ -3,11 +3,12 @@
%head
%title Eat Me
= stylesheet_link_tag "application"
+
- if @browser.mobile?
= stylesheet_link_tag "mobile"
- else
= stylesheet_link_tag "desktop"
-
+
= javascript_include_tag "application"
= csrf_meta_tags
@@ -3,10 +3,6 @@
%head
%title Eat Me
= stylesheet_link_tag "application"
- - if @browser.mobile?
- = stylesheet_link_tag "mobile", :cache => true
- - else
- = stylesheet_link_tag "desktop", :cache => true
= javascript_include_tag "application"
= csrf_meta_tags
@@ -1,6 +1,12 @@
%h2 Track Listing
-%ul
- = trackings.each do |tracking|
- %li
- tracking breakdown
+%ul.tracking-list
+ - trackings.each do |tracking|
+ %li.round-shadow.small-round
+ %a(href="#{tracking_path(tracking)}")
+ %span.big
+ tracking breakdown
+ %span.small
+ extra info
+.clear
+= link_to "Add Tracking", new_tracking_path
@@ -1,2 +1,6 @@
-%h1 Trackings#update
-%p Find me in app/views/trackings/update.html.haml
+%h2 Track Listing
+
+%ul
+ = trackings.each do |tracking|
+ %li
+ tracking breakdown
@@ -7,6 +7,5 @@
Show track info
%span.small
extra info
-
.clear
-= link_to "Add Tracking", new_tracking_path
+= link_to "Add Track", new_track_path
@@ -15,4 +15,4 @@
= render 'meals/list_meal', :meals => todays_meals(@user)
%h1.backplate-top
- = render 'tracks/list_track', :tracks => @user.trackings
+ = render 'trackings/list', :trackings => @user.trackings
@@ -13,3 +13,6 @@
.user-meals.backplate-bottom
= render 'meals/list_meal', :meals => todays_meals(@user)
+
+%h1.backplate-top
+ = render 'trackings/list', :tracks => @user.trackings
@@ -40,8 +40,7 @@ class Application < Rails::Application
config.filter_parameters += [:password]
# Enable the asset pipeline
- config.assets.enabled = false
- config.assets.initialize_on_precompile = false
+ config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
Binary file not shown.
@@ -53,7 +53,7 @@
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
- # config.assets.precompile += %w( search.js )
+ config.assets.precompile += %w( desktop.css mobile.css )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
@@ -0,0 +1,70 @@
+EatMe::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # Code is not reloaded between requests
+ config.cache_classes = true
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this)
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
+
+ # Specifies the header that your server uses for sending files
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.smtp_settings = {
+ :address => "mail.eatme.inventiongarden.com",
+ :port => 587,
+ :domain => "eatme.inventiongarden.com",
+ :user_name => "support@eatme.inventiongarden.com",
+ :password => "M0uthFu11",
+ :authentication => "plain",
+ :enable_starttls_auto => false
+ }
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # config.assets.precompile += %w( search.js )
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end

0 comments on commit 17f312a

Please sign in to comment.