Skip to content

Instantly share code, notes, and snippets.

View mrb's full-sized avatar
🍕
Helping companies market and sell more software

Michael Bernstein mrb

🍕
Helping companies market and sell more software
View GitHub Profile
module ActionView
module Helpers
class InstanceTag
def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0")
options = options.stringify_keys
options["type"] = "checkbox"
options["value"] = checked_value
if options.has_key?("checked")
cv = options.delete "checked"
checked = cv == true || cv == "checked"
From 8300f7a40465724f0ae19097a981f6c8d593bb61 Mon Sep 17 00:00:00 2001
From: mrb <mmbernstein@clinic-it.com>
Date: Wed, 17 Dec 2008 18:16:55 -0500
Subject: [PATCH] added ignore_hidden_field option to check_box tag
---
actionpack/lib/action_view/helpers/form_helper.rb | 29 ++++++++++++--------
1 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
@LOOKUP = {}
('A'..'GZ').each_with_index do |value, index|
@LOOKUP[value] = index
end
.header
="This text is in the header"
.body
="This text is in the body"
%b="This text is bold"
%table
%tr
%td="This is a table"
%td="Table me sonnnn"
?> "dude@dude.com".gsub(/\@/,'@\\')
=> "dude@\\dude.com"
>> puts _
dude@\dude.com
=> nil
$(document).ready(function(){
var beenShown = 0;
$(".column").click(function(event){
// for "click here tip"
beenShown = 1;
$("#clickme").slideUp();
$(this).toggleClass("selected");
$(".column").not(this).removeClass("selected");
---
Navigation:
---
1:
title: Web Based.
children:
---
1:
title: Child One
native: Here is the child One info.
var Favorite = {
client_name: "",
client_id: "",
user_id: "",
add_or_remove: "",
getID: function(params){
this.client_name = params.attr("client_name");
this.client_id = params.attr("client_id");
this.user_id = params.attr("user_id");
@mrb
mrb / way 1.js
Created April 26, 2009 21:13 — forked from quirkey/way 1.js
var Favorite = {
client_name: "",
client_id: "",
user_id: "",
add_or_remove: "",
getID: function(params){
this.client_name = params.attr("client_name");
this.client_id = params.attr("client_id");
this.user_id = params.attr("user_id");
var Favorite = {
postAction: function(params){
client_name: params.attr("client_name");
client_id: params.attr("client_id");
user_id: params.attr("user_id");
add_or_remove: params.attr("add_or_remove");
$.post('/users/'+this.user_id+'/'+this.add_or_remove+'_favorites.js',
{
id: this.user_id,