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
<% form_remote_for(@order, :builder => TaggedBuilder, :url => ship_admin_order_path(@order.applicant)) do |f| %> | |
<% fields_for ManualOrderInfo.new do |oi| %> | |
<label for="manual_order_info_note">Note:</label><%= oi.text_field :note %> | |
<% end %> | |
<%= submit_tag (@order.applicant.fulfilled? ? "Re-Ship" : "Ship") %> | |
<% 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 create | |
old_values = GeneralEdit.new(@board.attributes.slice(*GeneralEdit.new.attribute_names)) | |
new_values = GeneralEdit.new(params[:general_edit]) | |
new_values.attributes.each { |key, value| if value == "" then new_values[key] = nil end } | |
changed = new_values.attributes.diff(old_values.attributes) | |
session[:edit_result_id] = nil | |
if !changed.empty? then | |
@edit = GeneralEdit.new(changed) | |
@edit.board_id = params[:id] |
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 busy | |
result = EditResult.first | |
respond_to do |format| | |
format.js { result.to_json } | |
end | |
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
<script type="text/javascript"> | |
new PeriodicalExecuter(function(pe) { | |
new Ajax.Request("/general/busy/<%= @edit.id %>", { | |
method: "get", | |
onSuccess: function(transport) { | |
//we must figure out what to put here | |
} | |
} | |
}, 1); | |
</script> |
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
require 'hotcocoa' | |
require File.dirname(__FILE__)+'/mappings/status_item' | |
include HotCocoa | |
class Application | |
def start | |
application :name => "VPN Bar" do |app| | |
app.delegate = self | |
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 Player < ActiveRecord::Base | |
belongs_to :team | |
end | |
class Team < ActiveRecord::Base | |
has_many :leagues | |
has_many :players | |
end | |
class League < ActiveRecord::Base |
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
module ApplicationHelper | |
def content_block(name, &block) | |
override = yield(name) | |
return override unless override.blank? | |
return capture(block) | |
end | |
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 ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
rescue_from ActiveRecord::RecordNotFound do |e| | |
logger.error e.message | |
render_404 | |
end | |
protected |
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
ActionController::Routing::Routes.draw do |map| | |
map.resources :fans | |
map.resources :league_players | |
map.logout '/logout', :controller => 'sessions', :action => 'destroy' | |
map.login '/login', :controller => 'sessions', :action => 'new' | |
map.check '/check', :controller => 'sessions', :action => 'create' | |
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 User | |
class Authorization | |
end | |
end | |
u = User.new | |
a = User::Authorization.new |
OlderNewer