This file contains hidden or 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
| <li class="level0 level-top"> | |
| <a href="http://acumen-magento.gravdept.com/tour/">Acumen Tour</a> | |
| <div class="menu"> | |
| <ul class="level0"> | |
| <li class="level1"><a href="http://acumen-magento.gravdept.com/tour/features/">Features</a></li> | |
| <li class="level1"><a href="http://acumen-magento.gravdept.com/tour/design/">Design</a></li> | |
| <li class="level1"><a href="http://acumen-magento.gravdept.com/tour/ui-widgets/">UI Widgets</a></li> | |
| <li class="level1"><a href="http://acumen-magento.gravdept.com/tour/snippets/">Snippets</a></li> | |
| <li class="level1"><a href="http://acumen-magento.gravdept.com/tour/grid/">Grid System</a></li> |
This file contains hidden or 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
| <div class="grid"> | |
| <div class="grid_6"> | |
| {{block type=”catalog/product_new” column_count=”2” label=”New Products” template=”gravdept/catalog/new-products-slider.phtml” }} | |
| </div> | |
| <div class="grid_6"> | |
| {{block type=”catalog/product_list” category_id=”73” column_count=”2” label=”Featured Products” template=”gravdept/catalog/category-slider.phtml” }} | |
| </div> | |
| </div> |
This file contains hidden or 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
| class ApplicationController < ActionController::Base | |
| before_filter :protect | |
| protect_from_forgery | |
| def protect | |
| @ips = ['127.0.0.1', '116.155.117.121'] | |
| if not @ips.include? request.remote_ip | |
| # Check for your subnet stuff here, for example | |
| # if not request.remote_ip.include?('127.0,0') | |
| render :text => "You are unauthorized" |
This file contains hidden or 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
| documents | |
| has_and_belongs_to_many :category | |
| has_and_belongs_to_many :tags | |
| has_many :attachments, :dependent => :destroy | |
| categories | |
| has_and_belongs_to_many :documents | |
| tags | |
| has_and_belongs_to_many :documents |
This file contains hidden or 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
| Jul 23 12:08:01 Ubuntu-1104-natty-64-minimal CRON[9913]: (CRON) error (grandchild #9915 failed with exit status 127) | |
| Jul 23 12:08:01 Ubuntu-1104-natty-64-minimal CRON[9913]: (CRON) info (No MTA installed, discarding output) |
This file contains hidden or 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
| before_filter :protect | |
| def protect | |
| @ips = ['127.0.0.1', '192.168.1.0/24'] #And so on ...] | |
| allowed = false | |
| @ips.each do |ipstring| | |
| ip, mask = ipstring.split '/' | |
| mask = mask ? mask.to_i : 32 | |
| bip = 0 | |
| ip.split('.').each { |x| bip = (bip << 8) + x.to_i } |
This file contains hidden or 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
| class InvoicesController < InheritedResources::Base | |
| custom_actions :resource => :mark_paid | |
| def show | |
| show! do |format| | |
| format.html | |
| format.pdf do | |
| send_data(@invoice.render_pdf, :filename => "Invoice #{@invoice.id}.pdf", :type => "application/pdf", :disposition => "inline") | |
| end | |
| end |
This file contains hidden or 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
| class Invoice < ActiveRecord::Base | |
| validate :expiration_date_cannot_be_in_the_past, | |
| :discount_cannot_be_greater_than_total_value | |
| def expiration_date_cannot_be_in_the_past | |
| if !expiration_date.blank? and expiration_date < Date.today | |
| errors.add(:expiration_date, "can't be in the past") | |
| end | |
| end | |
This file contains hidden or 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
| # encoding: utf-8 | |
| class FaxUploader < CarrierWave::Uploader::Base | |
| # Include RMagick or MiniMagick support: | |
| include CarrierWave::RMagick | |
| # include CarrierWave::MiniMagick | |
| # Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility: |
This file contains hidden or 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
| # Use this hook to configure devise mailer, warden hooks and so forth. | |
| # Many of these configuration options can be set straight in your model. | |
| Devise.setup do |config| | |
| # ==> Mailer Configuration | |
| # Configure the e-mail address which will be shown in Devise::Mailer, | |
| # note that it will be overwritten if you use your own mailer class with default "from" parameter. | |
| config.mailer_sender = "admin@cargosurveyors.com" | |
| config.case_insensitive_keys = [ :username ] | |
| config.strip_whitespace_keys = [ :username ] |