class UploadForm
include ActiveModel::Model
attr_accessor :upload_file
validates_each :upload_file do |record, attr, value|
if value.present? && value.size > 1.megabytes
record.errors.add(attr, 'ファイルサイズがビッグだね')
end
This file contains hidden or 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
| <!-- <div class="block block--modifier"></div> --> | |
| <div class="block--modifier"></div> |
This file contains hidden or 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
| @mixin hoge-fuga { | |
| content: 'a'; | |
| } | |
| @mixin hoge_fuga { | |
| content: 'b'; | |
| } | |
| .hoge { |
This file contains hidden or 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
| class D3Example | |
| constructor: (@selector, width, height, @margin) -> | |
| @el = @defineRootElement(@selector, +width, +height, @margin) | |
| defineRootElement: (selector, width, height, margin) => | |
| @width = width - margin.left - margin.right | |
| @height = height - margin.top - margin.bottom | |
| d3.select(selector) | |
| .append('svg') | |
| .attr('width', width) |
This file contains hidden or 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
| class D3Example | |
| constructor: (@selector, width, height, @margin) -> | |
| @el = @defineRootElement(@selector, +width, +height, @margin) | |
| defineRootElement: (selector, width, height, margin) => | |
| @width = width - margin.left - margin.right | |
| @height = height - margin.top - margin.bottom | |
| d3.select(selector) | |
| .append('svg') | |
| .attr('width', width) |
This file contains hidden or 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 'pathname' | |
| require 'rmagick' | |
| images = Dir['*.png'] | |
| images.each {|image| i = Magick::Image.read(image).first; i.write(Pathname(image).sub_ext('.jpg')) { self.format='JPEG'; self.quality=80; }} |
This file contains hidden or 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
| class D3Example | |
| constructor: (@selector, width, height, @margin, hasBorder) -> | |
| @margin = top: 20, right: 20, bottom: 20, left: 20 unless @margin | |
| @el = @defineRootElement(@selector, +width, +height, @margin, hasBorder) | |
| defineRootElement: (selector, width, height, margin, hasBorder) => | |
| @width = width - margin.left - margin.right | |
| @height = height - margin.top - margin.bottom | |
| d3.select(selector) |
This file contains hidden or 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
| input[type=radio] { | |
| display: none; | |
| & + label { | |
| position: relative; | |
| padding-left: 24px; | |
| cursor: pointer; | |
| &::before, | |
| &::after { |
This file contains hidden or 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
| .switch-button | |
| .switch-button__button.is-active Type A | |
| .switch-button__button Type B | |
| .switch-button__button Type C |
This file contains hidden or 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
| %ul.List | |
| %li.List-item.List-item--active 1 | |
| %li.List-item 2 | |
| %li.List-item 3 |