Ȥ Blog

Ruby,C#

2009ǯ12

ActiveScaffoldundefined method `render_component'ȽФ

ɽΥ顼ФƤޤreder_componentʤäƤȡ ȤäƤߤ顢Rails2.3ϺƤޤä餷
ñActiveScaffold̤бʤ褦äΤǡ

script/plugin install git://github.com/lackac/render_component.git -r rails-edge

Ȥơץ饰reder_componentʤΤ򥤥󥹥ȡ뤷Ƥä꤯ޤ

iPhoneťɹ

äѤ֤ǽŤߤΤǡ󥳡ȤȤȯ䤷Ƥ2000ߤνťɤޤ äѥåΤۤǤ͡ СޤޤǤOKǤ
ΤϥꥳСǤޤʬĤϤɤϤ狼ޤ
AmazonΥӥ塼ǡ3GSǤϻȤʤȤΤޤʤȤϤʤ̤˻ѤǤޤ
Image194

OSXǥե󥯥󥭡ʤʤˤĤ

ҤϤ狼ޤ󤬡ܡɤΥե󥯥󥭡ʤʤ礬ޤȤä夦ޤ
äƤߤȤɤDock򤷤ƤȤǡDockƵưľȤΤȡ
˥ƥӥƥ˥WindowsǸȤΥޥ͡ΥץˤΤ)DockΥץλȤDockϵưƤޤ
ǡե󥯥󥭡̵衣
Ǥⲿʤ
ΥåץǡȤľƤʤʡ

49

RailsjQueryGoogleCDNǥ󥯥롼

ޤRailsץȤƤΤǤǽʳjQueryɤƲष֡ΤϺݤʡȤȤGoogle󶡤ƤΤפФơȤäƤߤ뤳Ȥˤޤ
¤ϺǽMicrosoftƱͤΥӥĴ٤ƤߤΤǤ뵤ʤʤΤǻߤޤ(^_^;)

ɥ쥹Ū˻ꤹˡȡGoogleAjaxAPIȤäưŪɤ߹ˡ褦Ǥ
ľܻꤷñǤAPIȤäʻ꤬ǽȤȤǤäǤäƤߤޤ
APIѤˤϥɬפȤΤȤǤ


<script type="text/javascript"
src="http://www.google.com/jsapi?key=APIΥ">
</script>


괺GoogleAjaxAPI򥤥󥯥롼ɤơ

google.load("jquery", "1.3");

ǡjQeury1.3ϤκǿǤ򥤥󥯥롼ɤ褦ˤƤߤޤ
1.3.xΤ褦˾ܺ٤ʥСꤹ뤳ȤǽǡάȾ˺ǿΤΤäƤƤȤΤȤǤ

ǡRailsǤPrototypeȤΤǡjQueryζ򤱤뤿ˡ
jQuery.noConflict();
Ȥäߤ顢jQueryʤƤʤ衢ܤ롣
Ū˥󥯤ʤΤǡ˽񤤤äܤʤ褦Ǥ

google.setOnLoadCallback(function(){
jQuery.noConflict();
});


ȤƤäơڡɸˤäƤ뤳Ȥˤޤ
ɥɤȡload᥽åɤΥץ callbackȤΤäơץȥɸ˸ƤӽФ롢ߤʤȤ񤤤Ƥäɡ꤯ޤǤ

ȤƱ褦
google.load("jqueryui", "1.7");
ǡUIȤ褦Ƥޤ

iPhoneΥɹ

֤ǽŤǤĤߤäǤ桹ʤäΤǼ괺ޤ

Image193



ǡŤΤǤUSBϥܡɤ餸ʤiMac΢¦Ф⤦Ȥäꤹ뤫⡣

2000ߤϤäȹ⤤褦ʵޤ

RailsMySQL ʸơ֥νäȴλ

MySQLǤUTF8ǥǡ١ơ֥ƤϤΤΡRailsdatabase.ymlΥץ
encoding: utf8
˺줿ˡɤlatin1ʸUTF8Ȥƽ񤭹ǤޤäƤ餷WindwsץǥޤǵŤʤäˡ⤦ʤ˥ǡѤƤޤäƤơɤ褦ƤʤȤˤʤޤ

ǡʤȤƮ̡μǴ¸UTF8Υơ֥latin1ǽ񤭹ޤ줿ǡUTF8줹뤳ȤǤޤ

ޤ

mysqldump my_db --default-character-set=latin1 > db_temp.dump

ǥס

create databaseǤUTF8ꤷƤΤǡפȤ򸫤ȤʸɤλUTF8ˤʤäƤϤΤǤRailsߥǼºݤΥǡlatin1ʤΤlatin1DB褦˥ץե񤭴

sed -e s/utf8/latin1/ db_temp.dump > latin1_db.dump

MySql¦ǰŪ˻Ѥlatin1DB

create database temp_db character set latin1;

Ȥơlatin1DBơ嵭Υפήࡣ

mysql temp_db < latin1_db.dump

latin1ǡ١ǤΤǡ⤦ס

mysqldump temp_db --default-character-set=latin1 > temp_db.dump

٤latin1UTF8֤

sed -e s/utf8/latin1/ temp_db.dump > utf8_db.dump

ǡѴפ򥪥ꥸʥDBήߤޤ

mysql my_db < temp_db.dump

ºݤΥǡUTF8ν夬ꡣ
Railsdatabase.yml
encoding: utf8
ɵơǰΤ
./script/cosole
ǥǡȤƤޤäƤ뤳Ȥǧ

¿ʬä̤ˡȤϻפΤǤ

MobileMe

ǯ֣ߤϹ⤤ʡȤפäƤåץMobileMeǤiPhone,MacBook,iMacʣMacȤäƤ뺣ȤʤäƤϡ줾ΥǡƱưŪˤäƤ뤳Υӥ˲ưʬˤǤΤǡƤޤޤ

iPodTochȤˤǻȤäƤߤΤǤλMacˤĤʤȤƱ顢̤ˤʤ󡢤ȤפäΤǤMac椢äƤɤä⤽ʤ˻ȤäƤȡɤƤǡƱʤäƤޤޤ
ʤǤ
Ǥ⤦äȰ¤ߤʡ

09


EverNoteȤʹơäĴ٤ΤǤޤ깥ߤ˹ʤäΤǤޤ

MobileMeǥȥåפȥΡȤǥޥåȤäƤͤˤʥӥǤ

ޥåWindowsalt + tab

WindowsǤAlt+TabǤ٤ƤWindow椫ǤդΤΤǤޤޥåǤ command + tab ǤȤWindowñ̤ǤϤʤץñ̤ˤʤäƤޤޤ
Ǥ⡡command + tab ǥץ򤷤֤ǡ岼Υ륭򲡤ȡΥץꥱWindowɽ뤳ȤĤäΤޤ
ŻΤäǶޥå桼ˤʤäͤäȺäƤ褦ʤΤǡ츫ƤäƤߤƤ

ȤǻŻäƴ롣

RailsǤ̲ߥեޥå

Viewإѡˤ̾⥺Х
number_to_currency

number_to_currency(number, options = {}) public

Formats a number into a currency string (e.g., $13.65). You can customize the format in the options hash.
Options

* :precision - Sets the level of precision (defaults to 2).
* :unit - Sets the denomination of the currency (defaults to "$").
* :separator - Sets the separator between the units (defaults to ".").
* :delimiter - Sets the thousands delimiter (defaults to ",").
* :format - Sets the format of the output string (defaults to "%u%n"). The field types are:

%u The currency unit
%n The number


ȤȤʤΤǡ褯꤬

?100,000-
Ȥϡ

<%= number_to_currency(1000000, :precision => 0, :format => "%u%n-", :unit => '?') %>

ȤФ櫓Ǥ͡
ʤۤɡ

6ָ˷ϻ

󡢵פ֤ɤߤޤ
ƤϲΤȤǤɤ⿴ޤ봶ɤäȻפޤ
ǽ1äϡޤ꿴ޤäǤʤǤ

ȥ6ָ˷ϻ
//Artist
, 1,680 ̼
ɾ
2009-12-05

ڽǼҡԤƾҲ

ĤŤ뱿̿λ̤Ҥ襤Ϥޤ롪 Υȡ꡼ƥ顼ġΥȥ󡦥ߥƥ꡼ ̿δϩ¤1ͤͽԤ롣 6ָ˷ϻ̡סǽвäΤǯͽ򤵤줿ΤïʤΤֱ̿פѤ뤳ȤϤǤΤ ̤ϷޤäƤʤ󤫤ʤ

ơʡBOOKץǡ١ˡ

ϻָ˷ϻ̡סǽвäΤǯͽ줿ΤïʤΤֱ̿פѤ뤳ȤϤǤΤ


ץե

Ȥ

C#ɻŻRubyФʳȯԡ
ǶDockerȤؿȤAngularJS˥ϥޤäƤ롣
¢ȤĮȤȤ˽ס

QR
QR
  • 饤֥ɥ֥