2007-09-15から1日間の記事一覧

rails radio_buttonにcheckedを付ける

<%= radio_button("hoge", "sage", 0, :checked=>'checked' ) %>下げ <%= radio_button("hoge", "age", 1) %>上げActionView::Helpers::FormHelper ↑もう少し詳しく書いてほしいよね・・・。 ※実行した環境 Ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswi…

Ruby on Railsで部分一致検索

Ruby on Railsで部分一致検索やってみました。 ( DB => Mysql ) params[:content] = "hoge" @count = Item.count(:conditions => ["test_c like ?", "%"+params[:content]+"%"]) @pages, @items= paginate(:item, :per_page => 20, :conditions => ["test_c …