Discover gists
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
// ========================================================================== | |
// Ring.Contact Fixtures | |
// ========================================================================== | |
require('core') ; | |
Ring.FIXTURES = Ring.FIXTURES.concat([ | |
// TODO: Add your data fixtures here. | |
// All fixture records must have a unique guid and a type matching the |
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
12 |
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
desc "Show merb routes" | |
task :merb_routes => :merb_env do | |
require 'merb-core/rack/adapter/irb' | |
Merb::Rack::Console.new.show_routes | |
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 has_permission(name) | |
(p = permissions.detect{|p| p[:name] == name } ) ? p[:active] : false | |
end | |
def has_one_of_permissions(ps) | |
ps = [ps].flatten | |
ps.each do |p| | |
return true if has_permission(p) | |
end | |
false |
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
<% view :contacts do %> | |
<div id="console"></div> | |
<h1>Contacts (<%= label_view :contacts_count, :outlet => true, :tag => :span, :bind => { :value => 'Ring.contactsController*content.count'} %>)</h1> | |
<% scroll_view :contacts_scroll, :outlet => true do %> | |
<%= list_view :contacts_list, :outlet => true, | |
:content_value_key => 'firstName', | |
:bind => { | |
:content => 'Ring.contactsController.arrangedObjects', | |
:selection => 'Ring.contactsController.selection' |
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
Hello world! |
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
/**========================================================= | |
menu selected | |
----------------------------------------------------------*/ | |
function ChangeSelected(id){ | |
if(document.getElementById(id) != null){//IDの存在をチェック | |
//SideMenuの子供のA要素からhref属性の値を取得 | |
var parentNode = document.getElementById(id); | |
var Tags = parentNode.getElementsByTagName("a"); | |
for (var i = 0; i < Tags.length ; i++){ | |
if(Tags[i].href==document.URL){//現在のURLとHREFの値が同じとき |
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
//IE6 select表示設定 | |
var searchSel=function(vl){ | |
var VarUsrAgt=navigator.userAgent.toLowerCase(); | |
var vuaMsie6=VarUsrAgt.indexOf("msie 6")!=-1; | |
if(vuaMsie6==false) return; | |
var tagSelect=document.getElementsByTagName('select'); | |
if(tagSelect==null) return; | |
for(var i=0;i<tagSelect.length;i++){ | |
tagSelect[i].style.display=vl; | |
} |
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
keyDown: function(evt) { | |
var nr = this.get('nextResponder') ; | |
return (nr && nr.keyDown) ? nr.keyDown(evt) : false; | |
}, |