Please Sign In No account? Create new user.
If you are using the Ruby on Rails acts_as_taggable plugin you may want to display the top tags in a tag cloud. To generate a tag cloud you will to write some code beyond just writing the controller action. You will need to augment the taggable plugin itself and create a function in the application helper. Lets start by adding a new method in the Tag model provided by the acts_as_taggable plugin.
http://dema.ruby.com.br/articles/2005/08/27/easy-tagging-with-rails 今流行のtag付け。最近のWebアプリケーションはネコも杓子もタグ!とりあえず便利そうだから付けとけ!って感じでどうでもいいところまでタグが実装されてたりすることもあって何だかなぁ、って感じだったりもするんだけどそれは置いといて。 どんな風に使えるのかというと、上記記事に書いてあるまんまで class Photo < ActiveRecord::Base acts_as_taggable # これ一行追加するだけ end elephant = Photo.find(4437) # idが4437のphotosテーブルのデータを取得 elephant.tag 'zoo animals nature' # tagをspace区切りで設定。なおphotosテーブ
NasuaはRuby on Railsで作ったメモ帳WEBアプリです。って今ではすっかりRailsな話題を取り上げるだけとなってしまいました。。 以前に gem install acts_as_taggable でインストールしたものを試したことがあったんですが、今度はRailsの プラグイン版 を試してみます。 Plugin だとvendor/の下にインストールされるのでほかのアプリにも影響がででないのでできればこちらを使いたいと思います。 インストール script/plubin install acts_as_taggable DBスキーマの追加 プラグインをインストーしただけではDBにテーブルは作成されません。自分で作成するひつようがあります。 まず migrationを実行します。 script/generate migration add_tag_support 生成されたファ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く