18 October 2006 — The "Fat Controller" anti-pattern is shown and dissected, and the reader is taken through the process of refactoring it into a more readable, maintainable, and testable solution — 5-minute read When first getting started with Rails, it is tempting to shove lots of logic in the view. I’ll admit that I was guilty of writing more than one template like the following during my Rails
_ AtomPub on Rails2 [atompub][rails] Rails で AtomPub する方法がよくわからない,というようなページを見 かけました. AtomPubサーバの開発中 たしかに,Rails による AtomPub サーバ構築については,情報が少ないよ うに思います. Rails を使い込んでないので中途半端ですが,誰かの参考になればという ことで簡単な実装方法を紹介します.Rails 2.0 以降が対象です.エラー 処理などはいい加減なので,適宜追加してください. ここでは,アプリケーション名を atompub とします. % rails atompub % cd atompub/ ■ scaffold DB には title, author/name, updated, content, app:edited の各要素を 保存するとし,scaffold し
15 January 2015 — A novel variation on a the Recursive Division maze generation algorithm, in which regions are defined by arbitrary clusters of cells instead of rectangular divisions of the grid. The algorithm is presented and illustrated, and its benefits over the original algorithm are put forth. A demonstration in JavaScript is provided — 4-minute read
Overview Safe ERB lets you make sure that the string written by "<%= %>" in your rhtml template is escaped correctly. If you try to show the attributes in the ActiveRecord instance read from the database or the parameters received from the request without escaping them using "h" method, an exception will be raised. This will significantly reduce the possibility of putting cross-site scripting vuln
Yesterday, I asked Twitter: Rails programmers: what's an example of one thing you find in other people's Rails code that you (almost) always consider to be wrong? Quite a few people responded, and several asked if I’d post the aggregated answers. Here’s an attempt. I don’t necessarily agree with everything here. I’d love to hear more of these in the comments. 1. Code in Views @greg_fu @briandoll
取得したRSSの中に広告と閲覧測定のためのタグが入っていることがある。 ある企業の場合、広告のURLとlinkタグでは閲覧測定のためのURLを挟み、本来のURLは<******:origLink>で挟むような形式にて提供している。 Railsの場合、ほとんどはRubyのRSSパーサでこれを読み込もうとするが、RSSライブラリから<******:origLink>を簡単に読み込むことが出来ない。そこで、hpricotライブラリを用いて<******:origLink>タグが存在したら、そのの内容をにコピーする方針で解決を行う。 まず、gemにてhpricotライブラリを読み込む。 # Rails 2.x # config/environment.rb Rails::Initializer.run do |config| config.gem "hpricot" : 通常は以下のように読み込む
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く