railsのedgeではデフォルトで入る(config.action_dispatch.default_headersに入れられる)が安定版(3.2.8)にはまだ入っていないので,暫定対応. https://github.com/rails/rails/pull/7390 configでデフォルトヘッダーを設定する方法がないためApplicationControllerのfilterでやるしかない?汚い… class ApplicationController < ActionController::Base after_filter :set_default_headers private DEFAULT_HEADERS = { 'X-Frame-Options' => 'SAMEORIGIN', 'X-XSS-Protection' => '1; mode=block', 'X-Con
技術部・開発基盤グループの村田です。 クックパッドは本日から、本番環境を Ruby 2.0.0-p0 に移行しました。Ruby 2.0.0-p0 は 2013年2月24日にリリースされた Ruby の最新バージョンです。新しい Ruby を使って気持ち良く開発するために、できるだけ早く Ruby をバージョンアップしようと尽力してきた結果が実りました。 Ruby のバージョンアップでレスポンスが高速になった クックパッドが Ruby 2.0.0 に対応したことで、ユーザと開発者の両者にとって、これまでよりも快適になっています。 Ruby のバージョン移行は、Ruby Enterprise Edition から Ruby 1.9.3-p392 を経由して Ruby 2.0.0-p0 へと段階的に実施しました。Ruby を Enterprise Edition から 1.9.3、そして 2.0
The RailsApps open source project offers starter applications and tutorials for Rails developers. All code explained in the Capstone Rails Tutorials. Generate the applications with the Rails Composer tool. Learn Ruby on Rails Get the book that is called "The best Rails book for beginners." See the 5 star reviews on Amazon. Learn how to get it FREE.
"A thought becomes an idea, becomes a dream, becomes inspiration, becomes reality" – Jaco van Staden Overview In this article I’m going to go through the process of using Ruby Version Manager (RVM) with my Build Server (Jenkins). This article will show how to set RVM and Jenkins up so I can run my Continuous Integration environment under the correct Rubies for my projects and with the correct Gem
Rod Hilton's rants about software development, technology, and sometimes Star Wars One of the nicest things about Ruby is how well it supports metaprogramming. You can dynamically, at runtime, change the behavior of any other class or module in the system, even private methods. When I was first learning Ruby, this seemed like a flaw, and while I still feel that this ability can be abused, it is de
I have a Rails application that I'm running on my server. When I go to a remote desktop and attempt to load the application, the server takes a good 3-4 minutes to respond with a simple HTML page. However, when I load up the page locally on the server, the page shows up in just a second. I tried pinging the server from my remote desktop and the pings are going through successful in a reasonable am
Redmine.JP Blog オープンソースのプロジェクト管理ソフトウェアRedmineに関するニュースや、より活用するためのtipsなどを掲載します Redmineを実行するサーバとは別のサーバからpublicディレクトリ以下の画像・CSS・JavaScript等のファイルを配信したい場合、例えばRedmine自体は海外のサーバで実行し、レスポンスタイムを短縮するために静的ファイルだけは日本国内のサーバから配信したいときなどは、Redmineのconfig/environment.rbに数行の設定を追加すれば簡単に実現できます。 設定方法 例えばRedmineのpublicディレクトリ以下にある静的ファイルを www.example.jp/redmine-assets/ から配信するようにしたい場合は、Redmineのインストールディレクトリのcofnig/environment.rb
この記事は 基本はRuby on Rails Guides: Asset Pipelineの訳ですが簡略化や自分の解釈で意訳した部分が多々あります。気になる点あったらコメントください。 Assets Pipelineとは Asset(アセット)とは、訳すと「資産」のこと。Assets Pipelineは画像やJavaScript、CSSを高速でリクエストを捌けるようにしたRails 3.1より標準搭載された仕組みです。 Assets Pipelineで出来ること Fingerprinting コンテンツベースのファイル名に更新することによるキャッシュ支援 Precompileを利用した高レベル言語でのコーディング CSSに対してSass/SCSS/LESS、JavaScriptに対してCoffeeScript等の中間言語が使用可能 ERBも使用可能 Assetの連結 複数のJavascri
Ruby on Rails Guides: Rails Internationalization (I18n) API を自己解釈しながら翻訳していきます。 この記事は3章までの内容になります。 はじめに I18n(internationalization) Gem はRails2.2から提供されており、多言語をサポートしたアプリケーションを提供するためのフレームワークである。 「国際化(I18n:internationalization)」を行うとは、全ての文字を抽象化し、日付や通貨などロケール(地域や言語)によるものをアプリケーションの外に出すことである。 「地域化(L10n:localization)」を行うとは、それらアプリケーションの外に出したものに対して、翻訳やフォーマットを提供することである。 I18n化するために必要なこと I18nのサポートを確保すること 辞書ファイルの場
Webサービスでは、JavaScriptファイルや、スタイルシート(CSS)ファイル、画像ファイルなど、細々とした多くの静的コンテンツ(静的ファイル)を扱う場合が多々あるかと思います。 そんな中、公開しているサービスへのアクセスが少し多くなってきた場合、静的コンテンツの配信サーバを、アプリケーションが稼動しているサーバとは別のものにしたくなりますよね。 また、画面内でアイコン画像を多数扱う場合等、多くの静的コンテンツを配信している場合などは、複数の静的コンテンツ用の配信サーバを準備し、負荷分散させることを考えますし、Amazon EC2など、海外のサーバを利用してサービスを展開する場合、どうしてもネットワークの遅延がネックとなりますので、細かい静的コンテンツの配信のみは、国内のサーバを使ったりしたくなる場合もあるかと思います。 そんなとき、Railsでは簡単に設定1つで切り替えられる仕組み
Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news. Developers hankering for more performance from their Rack and Rails applications are using Ruby 1.9 fibers and event-based EventMachine-driven libraries as a way to boost the performance of their applications - in opposition to scaling by merely running multiple processes or using threads. It's no secret that thread-based
コントローラ、ビュー、モデルにはloggerメソッドが用意されている。 logger.debug "ログメッセージ" logger.fatal logger.error logger.warn logger.info logger.debug prodcution環境ではdebugは出力されない。 productionでwarnレベルから出力するようにするならばenvironments/production.rbで config.log_level = :warn 個人情報をログに残さないようにする [[http://api.rubyonrails.org/classes/ActionController/Base.html#M000647|Class: ActionController::Base]]
You are here: Home > Using the Rails logger outside of models and controllers in Ruby You can use the Rails logger outside of Rails models in at least version 2.3.X and up of Rails. You might be used to doing the following in your models or controllers: If you make a regular model that doesn’t inherit from ActiveRecord, though, you may see the following error: undefined local variable or method `l
Posted by Mike Naberezny in Ruby In this article, we’ll take a look at how to use the logging facilities built into Rails and then share a few tips: Accessing the Rails Logger Log Levels Filtering Sensitive Parameters Creating Audit Logs ActiveRecord Logging to the Console ActionController Logging to the Console Firebug Console Accessing the Rails Logger Rails automatically sets up logging to a fi
著名なWebアプリケーションフレームワークのひとつにRuby on Rails がある。Ruby on Rails は、プログラミング言語 Ruby を対象として作られたWebアプリケーションフレームワークである。2004年7月に初めて登場し、2010年8月29日にはバージョン3が正式リリースされた。[1] Ruby on Rails は、多くの機能を備えた部類のフレームワークである。主に次の機能を備えている。 Web アプリケーションの基本構造 セッション維持の仕組み HTTPリクエストと処理モジュールのマッピング テンプレートエンジンによる Webページの生成 入力検査の仕組み ユーザ認証とアクセス認可の仕組み ※ データベースアクセス(O/R マッピング[注]等) REST サポート(URLのマッピング) Ajax サポート キャッシュ 等 ※ サードパーティから入手できる認証・認可
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く