特定のブラウザの問題修復にあたっており、この確認を省略する場合は、URL の末尾に ?browserok=trueGoogle ドキュメント を付けてください。 注: このパラメータの不正使用は禁じられています。 なお、まだ完全には機能しないのでご了承ください。
特定のブラウザの問題修復にあたっており、この確認を省略する場合は、URL の末尾に ?browserok=trueGoogle ドキュメント を付けてください。 注: このパラメータの不正使用は禁じられています。 なお、まだ完全には機能しないのでご了承ください。
Railsでアプリケーションを作成した際のデフォルトJS(AJAX)ライブラリはprototype.jsとscript.aculo.us。 しかし、昨今のajax開発にはjQueryを使う人が多いんじゃないかと。 っつーワケで、今更ながらRailsでjQueryを使ってみましょう。 今回は以下のサイトを参考にしました jQueryをRailsで·jRails MOONGIFT RailsにjQueryの導入 とは言ってもプラグイン"jRails"をインスコするだけ ruby script/plugin install http://ennerchi.googlecode.com/svn/trunk/plugins/jrails その後、headタグ内に <%= javascript_include_tag :defaults %> って記述してあげると 上のように展開され、デフォルトのjs
railsのルートが良く分からないからhttp://guides.rubyonrails.org/routing_outside_in.html を読んだ Quick Tour of Routes.rb http://guides.rubyonrails.org/routing_outside_in.html 1. The Dual Purpose of Routing リクエストのときとレスポンスのときの双方向でつかうよ 2. Quick Tour of Routes.rb ルートの種類は下記の5種類 RESTful Routes Named Routes Nested Routes Regular Routes Default Routes routes.rbの評価 上に書いたものが優先される (上から評価して最初にマッチしたものが採用) マッチしなかったら404エラー RESTful
比嘉さんからciteされたみたいなので、取り急ぎ新しい情報を吐き出しておこうと思います。 そろろろRailsについて本音を書いてみるか 後、デバッグの環境は、Javaに比べて貧弱だと思う。Railsでデバッグをする7つの方法を見てほしい。IDEでソースにブレークポイントを設定(ソースコードを書き換えるのではなく)して、ステップイン、ステップオーバー、メモリの状態を見たりなんてのに慣れているJavaから比べると、すっごく大変に見える。 喜ばしいことに、Rails 2.0ではruby-debugを使ったdebuggerが正式に採用されました。 これの使い方は非常に簡単です。 まずは、以下のようにブレークポイントをコード中に書き込みます。
全国のprintデバッグ愛好家の皆様、こんにちは。VSとかEclipseとかのIDE以外でデバッガを使ったことのない僕がやってきましたよ。 最近、C言語でヒーコラ言ってる真っ最中な訳ですが、C言語だとprintデバッグがやりにくい訳で、デバッガ様の力を借りてみたくなった訳です。という訳で、巷で有名な gdb をちょっと試してみました。 基本的な使い方は、以下を参考にしてます。gdb を用いたデバッグ方法GDBウノウラボ Unoh Labs: gdbの使い方 で、なんだか Emacsからも使えるみたいなんで、試してみたんですが、これが使いやすくてびっくり。"M-x gdb" で起動すると、Emacs のソース上に、現在の行が黒三角で、ブレークポイントが赤丸で表示されます。後は、コマンドラインでの操作と同じように、s とか n でステップ実行できます。 あー、もしかして、Perl とか Rub
This article was migrated from http://rails.office.drecom.jp/takiuchi/archive/174 Railsのレイアウトの仕組みは、レイアウトを明示的に指定しない場合は、fooコントローラに対してapp/views/layouts/foo.rhmltが存在する場合はfoo.rhtmlをレイアウトと見なし、存在しない場合はapp/views/layouts/application.rhtmlをレイアウトとして使用するようになっています。 両方とも存在しない場合はレイアウト無しと見なされます。 これを、foo.rhtmlをレイアウトとして使用しつつ、さらにその外側のレイアウトとしてapplication.rhtmlを使用するようにするには、コントローラに以下のようなafter_filter を追加すればOKです。 class F
Railsでページを表示する時に必ずお世話になるrenderメソッド。そんな一番身近とも言えるrenderメソッドなのに、昨日初めて知った機能がある。小さな機能なのだが、今まで知らずに使っていて大分損をした気分だ...。 覚えたこと 以下のようなコード例で考えて... render :partialに:collectionオプションが設定されていると... パーシャルファイル(_list_item.rhtml)のファイル名*1のローカル変数(list_item)に@slipsの内容を代入して、描画処理を実行する。(知っていた。) さらにローカル変数list_item_counter*2には0から始まるインデックス値(0, 1, 2, 3...)*3が代入されている!(知らなかった...。) Rails 2.1.0では1から始まるインデックス値(1, 2, 3, 4...)に変更になった。
知らないうちに、will_paginateのインストール方法が変わっていたようだ。その昔書いたエントリのやり方は、もはや古い。 当初、will_paginateはRailsのプラグインとしてインストールするようになっていた。 $ ruby script/plugin install will_paginateしかし、しばらくしてrubygemsで管理するよう変更された。 $ sudo gem install will_paginateその後、今度はwill_paginateの管理をGitHubで行うようになったため、またまた変更になった。 今回触れるのは、現時点(バージョン2.3.1)で最新のインストール手順だ。ちなみに、英語のドキュメントを読める人は、rdocやwikiの通りにやれば解決。 インストール まず、rubygemsにGitHubをリポジトリとして追加する。 $ sudo ge
こんにちは、KBMJの中平@railsエンジニアです。 今回はruby on railsでグラフを表示させようと思います。 rubyでグラフを作成するのは、Gruff というプラグインがありますが 今回は Gruffではなく Open Flash Chart というグラフ作成プラグインを使用してみます。 このプラグインの特徴は、その名の通りグラフをFlashで表示するプラグインなので、Gruffを使った場合より見た目がいいグラフができるかも? ということで、さっそくruby on rails でグラフを作成してみます。 続きはこちら http://doruby.kbmj.com/nakahira_on_rails/20081021/ruby_on_rails_graph_Open_Flash_Chart_
会社のプロジェクトで使われているActiveRecordの関数を紹介。 lib/active_record/active_record_helper.rb module ActiveRecordHelper def flatten_conditions(conditions, op = "and") return nil if conditions.empty? ps = [] condition = conditions.collect do |c| next if c.size < 1 ps += c[1..(c.size)] "( #{c[0]} )" end.delete_if { |c| c.blank? }.join(" #{op} ") [condition, ps].flatten unless condition.empty? end end class ActiveRe
http://blog.masuidrive.jp/articles/2006/05/23/rails-on-osx-and-emacs http://blog.masuidrive.jp/articles/2006/05/23/rails-on-osx-and-emacs これを実際に試そうという試み. EmacsなのにEclipse以上の環境を作る事ができました. そもそもEclipseよりEmacsのほうが使いやすい感がある(主観)ので,こりゃスゴい事になるかもしれんぞ. あとは,migrationをもう少し楽にできるツールが欲しいかな. もうEmacsとターミナルが動いているだけで良いのなら,それ以外に望むものは無い・・・.やってみる! Subversionの恩恵は未だに受けた事が無いので,ちゃんと受けれるようになってからpsvn.elを使ってウハウハすることにする.ので,今回イン
2008年08月24日 オートコンプリートのできるテキストボックス rails2.1で郵便番号記入用のオートコンプリートつきテキストボックスを作ってみた。 下記のように書くと単純だが、オートコンプリートを実現している仕組みはなかなか複雑。数時間もせずに動くものができてしまうなんて、railsとAjaxのライブラリさまさまだと思った。 大半の知識はこちらからを参照した。 検索可能なプルダウンリストのオプション設定の調査 www.railsdocumentation.orgのActionView::Helpers::JavaScriptMacrosHelper 手順の概要 ■Rails2からauto_completeはPluginになったので、インストールする ruby script/plugin install http://svn.rubyonrails.org/rails/plugins
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く