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
<%= link_to "Chart", manage_downloads_path(:view_graph => nil, :inner_tab => @inner_tab, :current_tab => @current_tab), :class => 'btn btn-primary' + (@view_graph ? 'active' : '') %> |
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
def stocked_styles | |
joins("INNER JOIN wine_instances wi ON wi.id = stocks.wine_instance_id INNER JOIN wines w ON w.id = wi.wine_id INNER JOIN styles s ON s.id = w.style_id").select("DISTINCT(s.name) AS style_name").order("style_name").map { |s| s.style_name } | |
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
def stocked_countries | |
joins(<<END | |
INNER JOIN wine_instances wi ON wi.id = stocks.wine_instance_id | |
INNER JOIN wines w ON w.id = wine_instances.wine_id | |
INNER JOIN countries c c.id = w.country_id | |
END).select("DISTINCT(c.name) AS country_name").order("country_name").map { |v| v.country_name } | |
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
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}_routes.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :admin | |
draw :frontend | |
draw :resources |
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
<div class="control-group"> | |
<%= f.label_tag :${1:name}${2:, "${3:Name}"}, :class => "control-label${4: required}" %> | |
<div class="controls"> | |
<%= f.${5:text_field}, :${1}${6:, :class => "${7:span5}"} %> | |
</div> | |
</div> |
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
AED United Arab Emirates Dirham | |
AFN Afghanistan Afghani | |
ALL Albania Lek | |
AMD Armenia Dram | |
ANG Netherlands Antilles Guilder | |
AOA Angola Kwanza | |
ARS Argentina Peso | |
AUD Australia Dollar | |
AWG Aruba Guilder | |
AZN Azerbaijan New Manat |
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
Wvision::Application.routes.draw do | |
namespace :api do | |
resources :accounts do | |
resources :cellars, :only => [:index, :create] | |
resources :wine_queue, :only => [:index] | |
resources :wines_to_pull, :only => [:index] | |
match '/queue/wines-to-pull', :to => 'wines_to_pull#index' | |
match '/queue/:name', :to => 'wine_queue#index' | |
end | |
resource :user_session, :controller => 'user_session' |
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
<?php | |
/** | |
* sfProgressBar | |
* | |
* Draw a nifty progress bar for command-line tasks | |
* | |
* USAGE: | |
* // Create Progress Bar instance, pass number of increments | |
* $progressBar = new sfProgressBar($numItems); | |
* |
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
def rebate_status(rebate_claim) | |
case rebate_claim.status | |
when 0 | |
output = "New Claim" | |
when 1 | |
output = "Pending LT Verification" | |
when 2 | |
output = "Pending Property Verification" | |
when 3 | |
output = "Disputed" |