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
!!! | |
%html | |
%head | |
- page_title = yield :title | |
%title= (page_title.present? ? "#{page_title} - " : '') + 'SITE_NAME' |
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
- title @post.title |
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
- if hoge? | |
.image= image_tag hoge.url, id: 'hoge' | |
- else | |
%img.image{id: 'hoge', style: 'display:none'} |
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
if hoge? | |
image_tag hoge.url, id: 'hoge' | |
else | |
image_tag nil, id:'hoge', style: 'display:none' | |
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
module ActionView | |
module Helpers | |
module FormTagHelper | |
alias_method :original_submit_tag, :submit_tag | |
def submit_tag(value=nil, options={}) | |
options[:disable_with] = 'Sending...' unless options[:disable_with] | |
original_submit_tag(value, options) | |
end | |
end | |
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
module ActionView | |
module Helpers | |
module FormTagHelper | |
alias_method :original_submit_tag, :submit_tag | |
def submit_tag(value=nil, options={}) | |
options[:disable_with] = options[:disable_with] == '' ? nil : 'Sending...' | |
original_submit_tag value, options | |
end | |
end | |
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
# coding: utf-8 | |
require 'spec_helper' | |
feature 'Create new story', js: true do | |
background do | |
visit '/users/sign_in' | |
within("#new_user") do | |
fill_in 'user[email]', with: '[email protected]' | |
fill_in 'user[password]', with: 'testtest' | |
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
window.confirm = function () { return true; }; | |
xs = document.getElementsByClassName("deleteLink"); | |
for (var i = xs.length - 1; i >= 0; i--) { | |
xs[i].click(); | |
} | |
location.reload(); |
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
$.ajax | |
type: 'get' | |
url: '画像のURL' | |
success: -> | |
そのまま表示 | |
error: -> | |
デフォルト画像を表示 |
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
Ranking.constants | |
=> [:GeneratedFeatureMethods, :ClassMethods, :ConnectionSpecification, :OrmAdapter, :COLUMNS, :Statements, | |
:TableDefinition, :CommandRecorder, :AttachmentContentTypeValidator, :HelperMethods, :AttachmentPresenceValidator, | |
:AttachmentSizeValidator, :Defining, :Running, :SingletonMethods, :InstanceMethods, :TransactionError, | |
:MacroReflection, :AggregateReflection, :AssociationReflection, :ThroughReflection, :Serializer, :ASSOCIATION_TYPES, | |
:AssociationBuilderExtension, :TooManyRecords, :UNASSIGNABLE_KEYS, :InstanceMethodsOnActivation, :Middleware, | |
:Association, :SingularAssociation, :CollectionAssociation, :CollectionProxy, :BelongsToAssociation, | |
:BelongsToPolymorphicAssociation, :HasAndBelongsToManyAssociation, :HasManyAssociation, :HasManyThroughAssociation, | |
:HasOneAssociation, :HasOneThroughAssociation, :ThroughAssociation, :Builder, :Preloader, :JoinDependency, | |
:AssociationScope, :AliasTracker, :JoinHelper, :CALLBACKS, :Attribute, :ATTRIBUTE_TYPES_CACHED_BY_DEFAULT, |