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
# Only for Rails3 | |
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' | |
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' |
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
id delaying = [CCDelayTime actionWithDuration:1.5f]; // duration is second, not millsecond. | |
id sequence = [CCSequence actions:someAction, delaying, nil]; | |
CCRepeatForever *repeatAction = [CCRepeatForever actionWithAction:sequence]; | |
[aSprite runAction:repeatAction]; |
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
CCSpriteSheet *animationSheet = [CCSpriteSheet spriteSheetWithFile:@"animation_sheet.png"]; | |
[self addChild:animationSheet]; | |
CCSprite *animationSprite = [CCSprite spriteWithTexture:animationSheet.texture | |
rect:CGRectMake(0, 0, 256, 290)]; | |
animationSprite.position = ccp(self.contentSize.width / 2, self.contentSize.height / 2); | |
[animationSheet addChild:animationSprite]; | |
CCAnimation *animation = [CCAnimation animationWithName:@"an_animation" delay:0.04f]; |
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
# -*- coding:utf-8 -*- | |
# will_paginateで出力されるページネーションの日本語化 | |
WillPaginate::ViewHelpers.pagination_options = { | |
:class => 'pagination', | |
:previous_label => '«前へ', | |
:next_label => '次へ»', | |
:inner_window => 4, # links around the current page | |
:outer_window => 1, # links around beginning and end | |
:separator => ' ', # single space is friendly to spiders and non-graphic browsers | |
:param_name => :page, |
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
require File.expand_path('../config/application', __FILE__) | |
require 'rake/dsl_definition' # add this | |
require 'rake' |
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
<!-- this doesn't work on IE (Google default) --> | |
<g:plusone size="medium"></g:plusone> | |
<!-- this works --> | |
<div class="g-plusone" data-size="small" data-count="true"></div> | |
<!-- without plus count --> | |
<div class="g-plusone" data-size="small" data-count="false"></div> |
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 :users, :url => {:action => :create_multi}, :html => {:method => :post} do |f| %> | |
<% 0.upto(3) do |i| %> | |
<%= f.text_field :name, :index => i + 1 %> | |
<% end %> | |
<%= f.submit 'upload' %> | |
<% 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
<%= form_for :user, :url => {:action => :create}, :html => {:method => :post, :multipart => true} do |f| %> | |
<%= f.text_filed :name %> | |
<%= f.file_filed :image %> | |
<% 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
gem 'rails', '3.1.0' | |
... | |
# add for assets | |
gem 'sass' | |
gem 'coffee-script' | |
gem 'uglifier' | |
gem 'jquery-rails' |
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
gem 'therubyracer' # add this |
OlderNewer