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
it "should return Saved when passed params" do | |
post :update, :content => {"content", "Seniors"} | |
response.should contain("Saved") | |
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
if (NON_NEGATIVE.containsInteger(startRecord) | |
&& NON_NEGATIVE.containsInteger(endRecord) | |
&& olbRequest.isDirtyFlag()) | |
{ | |
String orderBy = olbRequest.getOrderBy(); | |
if (NON_NEGATIVE.containsInteger(categoryId) | |
&& customerId != null) | |
{ | |
results = getAcctHistoryByCategory(tpc, startDate, endDate, orderBy, startRecord, endRecord, categoryId, customerId, aid); |
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 CommentsController < ApplicationController | |
include UrlHelper | |
OPEN_ID_ERRORS = { | |
:missing => "Sorry, the OpenID server couldn't be found", | |
:canceled => "OpenID verification was canceled", | |
:failed => "Sorry, the OpenID verification failed" } | |
before_filter :find_post, :except => [:new] | |
def index |
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 authenticate_with_open_id(identifier = nil, options = {}, &block) #:doc: | |
raise "Test" | |
OpenID::Util.logger.info "Authenticating with open id" + identifier | |
identifier ||= open_id_identifier | |
if request.env[Rack::OpenID::RESPONSE] | |
complete_open_id_authentication(&block) | |
else | |
begin_open_id_authentication(identifier, options, &block) | |
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
<html> | |
<head> | |
<script src="javascripts/jquery-1.6.2.js" type="text/javascript" ></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('input').click(function(event) { | |
alert("This worked ..." + event.type); | |
}); | |
$("#content").html("<input type='button' value='Loaded later'/>"); | |
}); |
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
public class Thing { | |
private String title ; | |
private List<Thing> children ; | |
public Thing(String title) { this.title = thing ); | |
// getters and settors accordingly | |
} | |
List<Thing> things = new ArrayList<Thing>() ; | |
things.add(new Thing("One")); |
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
#ruby 1.9.2 | |
require 'json' | |
class Item | |
def initialize(name, description ) | |
@name = name | |
@description = description | |
end | |
def to_json(*a) | |
{"name" => @name, "description" => @description}.to_json(*a) |
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
routes.rb | |
================= | |
resources :groups do | |
member do | |
post 'join' | |
put 'add_contact' | |
end | |
end | |
When I do "bundle exec rake routes" I get "add_contact_group" -> /groups/:id/add_contact |
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
#This form "should" create a new contact and a new group_contact record. What I really | |
# want to do is to add an existing contact to a group. But can't figure out | |
# how to build a form_for that will let me do that. | |
# | |
# If I were creating my own form, I'd just put the group_id in a hidden field and let | |
# the user pick a contact from a select. Then I'd post to a groups_controller | |
# to add the contact to group.contacts. | |
# | |
# I'm just not seeing how to do that in a form_for | |
# |
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 ContactMethod < ActiveRecord::Base | |
validates_presence_of :name | |
def self.select_options | |
descendants.map { |c| c.to_s }.sort | |
end | |
end | |
class Phone < ContactMethod | |
end |
OlderNewer