ひとりPokenサイト構築

show で見せる

http://www.yssk22.info/relax/_design/aboutme/_show/home/yssk22

で、このデータをかき集めてくるのがRaindropの仕事なんだが、全然期待したとおりにうごかないので、ひとまずadhocに作り続ける。ある程度終わったらOpenSocialの皮を被せて完成。

なんちゅう開発の仕方をしているんだ、っていう話がありますが。

本日の便利関数 content_tag

ActiveSupport になれきっているので、片っ端からJavaScriptに持って行きますw まとまったところでgithubにのせますかね。

function content_tag(name, content, options){
  var str = "<" + name;
  if( options ){
    str += " ";
    for(var attr_name in options){
      str += attr_name + '="' + options[attr_name] + '" ';
    }
  }
  str += ">";

  if( content ){
    if(typeof(content) == "function"){
      str += content();
    }else{
      str += content.toString();
    }
  }
  str += "</" + name + ">";
  return str;
}