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_for @foo do |f| %> | |
<%= f.text_field :name %> | |
<%= f.text_field :color %> | |
<%= f.submit 'Save' %> | |
<%= f.email_field :friend %> | |
<%= f.submit 'Semd to a friend', formaction: params.merge(action: 'send_to_friend') %> | |
<%- end -%> | |
<script type="text/javascript"> | |
if(! ('formAction' in document.createElement('input') ){ | |
document.addEventListener('click', function(evt){ |
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
Number.prototype.formatMoney = function(c, d, t){ | |
var n = this, | |
c = isNaN(c = Math.abs(c)) ? 2 : c, | |
d = d == undefined ? "," : d, | |
t = t == undefined ? "." : t, | |
s = n < 0 ? "-" : "", | |
i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", | |
j = (j = i.length) > 3 ? j % 3 : 0; | |
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); | |
}; |
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
// get a reference to the color examples, and hide them all | |
var color_samples = $$('#color-sample img').invoke('hide'); | |
// get a reference to all of the color radio group elements | |
var colors = $$('input[name="color"]'); | |
// handler function to show only the selected color swatch | |
var choose_color = function(){ | |
// re-hide all of the swatches | |
color_samples.invoke('hide'); | |
// loop through the color buttons | |
colors.each(function(elm, idx){ |
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
(function($, undefined) { | |
/** | |
* Unobtrusive scripting adapter for jQuery | |
* https://github.com/rails/jquery-ujs | |
* | |
* Requires jQuery 1.8.0 or later. | |
* | |
* Released under the MIT license | |
* |
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"> | |
window.addEventListener('load', function(evt){ | |
var box = document.getElementById('PageDiv'), h; | |
if (box.hasOwnProperty(outerHeight)){ // old IE | |
h = box.outerHeight; | |
}else{ | |
var style = document.defaultView.getComputedStyle(box, ''); | |
h = style.getPropertyValue("height"); | |
} | |
if(top.resize_iframe) top.resize_iframe( parseInt(h, 10) ); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Inner 1</title> | |
<style type="text/css" media="screen"> | |
body { | |
height: 100%; | |
margin: 0; | |
} |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Inner (menu) page</title> | |
<script type="text/javascript"> | |
window.addEventListener('load', function(evt){ | |
var menu = document.getElementById('item1'); | |
if (menu.hasOwnProperty(outerHeight)){ // old IE | |
top.resize_iframe( parseInt(menu.outerHeight, 10) ); |
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
<!-- add these lines to the HEAD of the page — before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.7/prototype.js" type="text/javascript" charset="utf-8"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.9/scriptaculous.js?load=effects" type="text/javascript"></script> | |
<!-- add these lines to the very end of the BODY of the page — before </body> --> | |
<script type="text/javascript"> | |
if(window.location.search){ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta http-equiv="Content-Language" content="en"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" type="text/css" media="screen"> | |
<title>API Test</title> | |
</head> | |
<body> |
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
Rails.application.config.assets.prefix = '/the-other-assets' |