発行:インプレス
ImageMagick v6 Examples -- Resize or Scaling (General Techniques) Resizing Images Ignore Aspect Ratio ('!') Only Shrink Larger ('>') Only Enlarge Smaller ('<') Fill Given Area ('^') Percentage Resize ('%') Pixel Count Limit ('@') During Image Reading Other Specialised Resize Operators Geometry - Resize just the last image Thumbnail - Resize with profile stripping Resample - Changing an images reso
1.0.0 1.1.0 1.1.1 1.1.6 1.2.0 1.2.6 2.0.0 2.0.1 2.0.3 2.1.0 2.2.1 2.3.2 2.3.8 3.0.0 3.0.5 3.0.7 3.0.9 3.1.0 3.2.3 3.2.8 3.2.13 4.0.0 4.1.0 4.2.1 説明 クラス名からファイル名へ変換する。 「config/initializers/inflections.rb」に定義を追加することによって、追加できる。 使い方 <クラス名>.underscore 例 「Product」を変換 "Product".underscore # "product" 「AdminUser」を変換 "AdminUser".underscore # "admin_user" 「Backoffice::Session」を変換 "Backoffice::Session".unders
Paperclip Deprecated Paperclip is deprecated. For new projects, we recommend Rails' own ActiveStorage. For existing projects, please consult and contribute to the migration guide. We will leave the Issues open as a discussion forum only. We do not guarantee a response from us in the Issues. We are no longer accepting pull requests except pull requests against the migration guide. All other pull re
So, I want to resize images to a FIXED width, but proportional height. I have been trying a wide range of operators: 380x242# 380x242> 380!x242 380x242< none of them have the desired effect. Any help? I want it to fill or resize to the 380 width, then resize / shrink the height by the same factor it used to shrink or resize the image to 380 wide.
どうもこんばんは。Toshikuraです。今回のTipsは【jQuery iframeの読み込み完了後のタイミングで処理を実行する方法】です。局所的な記事が続いていますが地味に使えるTipsなのでメモしておきます。デモの方を見ていただければざっくりとした使い方が掴めるかと思います。もしよろしければ合わせてご確認ください。 iframeの読み込み完了後のタイミング 読み込みのタイミングで何らかの動作をさせる場合は以下のような記述で実装可能です。 HTML <iframe id="tgt" src="http:****.com"></iframe> JS <script type="text/javascript"> $(‘#tgt’).load(function(){ console.log(‘読み込み完了’); }); </script> クリック等のタイミングで読み込み 次の例はクリック
Not your computer? Use a private browsing window to sign in. Learn more about using Guest mode
先月、Railsのブログにこんな記事が載りました。 http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-the-new-primary-http-method-for-updates/ なぜか当初とURLが変わっているようで、ブックマークは Edge Rails: PATCH is the new primary HTTP method for updates | Riding Rails のほうが多いです。(たしかこっちはブログのコメントもいっぱいついてたと思うんだが消えている…) これは簡単に言うと、 ということなんですが、僕が記事を読んだ限りの解釈をもう少し詳しく説明したいと思います。 PUTは冪等 Railsのroutes.rbで resources :users と書くと、いくつかのルーティングが生成されますが、
I'm using the form_for helper and would like it to submit to an iframe. <%= form_for(section, :target => 'new_section_frame') do |f| %> ... <% end %> I should then be able to call $('form').submit() and have the form submit to the iframe. It would work except that the target isn't present in the output html. The Rails guide on form helpers doesn't have this particular example.
FSWiki記法等です。 見出し 行を!ではじめると見出しになります。見出しは3レベルあります。 !!!大見出し !!中見出し !小見出し 大見出し 中見出し 小見出し テキスト装飾 シングルクォート2つで囲むと''イタリック''になります。 シングルクォート3つで囲むと'''ボールド'''になります。 これは==打ち消し線==です。 これは__下線__です。 シングルクォート2つで囲むとイタリックになります。 シングルクォート3つで囲むとボールドになります。 これは打ち消し線です。 これは下線です。 引用 ""これは引用です。 ""これも引用です。 これは引用です。 これも引用です。 説明 :項目:説明文 項目 説明文 ::項目 :::説明文は複数行にわけて書くこともできます。 :::こんな感じで。 項目 説明文は複数行にわけて書くこともできます。こんな感じで。 項目 行を*ではじめると
一覧 ヘルプ ログイン ANDOR FreeStyleWiki 編集FAQ トップ kokodayo.net版 FreeStyleWiki 編集FAQです。 入力 文章の入力 FSWiki記法 FSWiki記法 ファイルの添付 ファイルを添付する 画像を表示する テキストを表示する テーブル テーブル テーブル応用 プラグイン プラグイン プラグインヘルプ 管理 メニュー プラグイン Help ログイン 公開の制限 デザイン メールアドレス 文字化け 用語 FSWiki FrontPage 新規 編集 差分 一覧 ソース Farm SandBox 凍結 Keyword WikiName InterWiki Header Footer タイムスタンプ テンプレート 一般 CSS RSS パラグラフ インライン ブロック GPL 最終更新時間:2013年08月25日 09時04分13秒 Cop
Amazon’s S3 file hosting service is a scalable, easy place to store files for distribution. You can find out more about it at aws.amazon.com/s3 To use Paperclip with S3, include the aws-sdk-s3 gem in your Gemfile: gem 'aws-sdk-s3' There are a few S3-specific options for has_attached_file: s3_credentials: Takes a path, a File, a Hash or a Proc. The path (or File) must point to a YAML file containin
[追記: 2012/1/19] aws-s3ではなくaws-sdkを使用する仕様に変更されたようなので、ご注意ください。 以前も書きましたが、Ruby on Rails で画像などをアップロードするときにお世話になるGemが「Paperclip」といいます。 thoughtbot/paperclip · GitHub 初心者のためのRailsのプラグインまとめ - 常識という迷信 結論から先に言うと、Paperclipを修正してAmazon S3@tokyoを使いやすくしたので紹介します。 よって、Paperclipの基本的な使用方法などは説明していませんので、後述のリンクを辿っていただければと思います。 AmazonS3@tokyoを使おうと思ったらエラーがでます 最近、Amazon S3 を使い始めて、東京にもあるということで、「近いほうがいいだろう」という安直な理由で使うことにしたの
You are here: Home / 2012 / 4月 / 11 / PaperclipでAmazon S3 Tokyo Regionに画像をアップロードする PaperclipでAmazon S3に画像をアップロード方法について、まとめてある最近の記事がなかったので、記録しました。Paperclipの最新バージョンでは改変することなくTokyo Regionにもアップロードすることができるようになっています。 Amazon S3でのBucketの作成などは完了しているものとします。 Gemfileへpaperclip, aws-s3, aws-sdkを追加し、bundle installを実行します。 Gemfile 2012年4月11日時点においては、gemで取得するpaperclipの最新バージョンは3.0.1であったのですが、3.0.1にはS3について既知の問題があったため、
月曜日なので一心不乱にコード(仕事の)。 画像アップするプラグインを前に目を付けていたPaperclipに変えてみた。 file_columnと同じでファイルに画像を保存する形式。で、attachment_fuと違って専用のテーブルを作らないタイプ。 うーん、ファイルに保存方式だとcapistranoでdeployしてるとき困るんだよな~。そんでsystem以下に保存するように変えたり。 とりあえず使ってみた。 class User < ActiveRecord::Base has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" } end モデルにhas_attached_fileを定義。 class AddAvatarColumnsToUser < ActiveRecord:
目次 環境 インストール 実装 テスト 参考 環境 Ruby: 2.0.0-p0 Rails: 3.2.13 paperclip: 3.4.1 インストール ImageMagickが必要なので, 確認して無かったらインストールしておく. which convert # 無かったら次でインストール brew install imagemagick 後はいつも通り, Gemfileにgem 'paperclip'を追加してbundle installすればよい. 実装 既存のUserモデルにアイコンとしてavatarを追加し, 登録, 編集, 表示が出来るようにする. まずは, rails g paperclip user avatarしてrake db:migrateしておく. 生成されたマイグレーションファイルの中身はこんな感じ. class AddAttachmentAvatarToUs
Ruby界のファイルアップロードのライブラリはいくつかあるけど、PaperclipとcarrierwaveがTOP2らしい。 どっちも歴史、機能、活発度的に大きく変わらないようだけど以下の点からpaperclipを使って見ることにした。 要件はどちらも満たしている(Rails、S3対応くらい) 使い方をざっくり見たところ、paperclipのほうがシンプルに見える(あまり変わらない)。 carrierwaveはいろんなモノに対応しすぎててちょっと重すぎに見える。 Railsへの対応のしかたもpaperclipはバージョンごとに過去のRailsをバッサリ切り捨ててRailsに合ってそう。 carrierwaveはpaperclipからの移行I/Fも備えているので、paperclipが嫌になったら移行すればいい 動作まで とりあえずS3は置いておいて、publicディレクトリ配下にアップロード
This article was contributed by Tute CostaTute is a developer at thoughtbot NYC. You can find him on twitter @tutec . Many web apps require the user to upload images and other files for storage and processing. Paperclip is a cleanly abstracted Ruby library that reduces the complexity of file uploading and processing. Using Paperclip with an external storage service such as Amazon S3 or Rackspace C
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く