imageタグのヘルパー
<%= image_tag('filename', :size => '100x100', :alt => 'imagefile') %>

cssのヘルパー common.cssの場合
<%= stylesheet_link_tag 'common' %>
public/stylesheet下のファイルを参照する

aタグのヘルパー
<%= link_to 'link_name', 'http://domain' %>



セッションIDを使う際のメモメモ。
・セッションIDをクッキーに保存したり、セッションIDを取り出す処理はRailsが自動的に行ってくれる
・セッションIDの使い方は次の通り
@userオブジェクトのitemを保存
 session[:test_id] = @test.id

 セッションから取得したidを使い、@testオブジェクトを作る
 @test = Test.find(session[:test_id])


あるアクションが完了したら、別のURLにリダイレクトする処理をメモ。

top_controller.rbを以下のようにする
def goto
redirect_to :action => 'about'
end

保存後、gotoというアクションを実行すると、aboutへ移動

----------------------
コントローラーやパラメータ, URLを指定することも可能。

redirect_to :controller => 'test', :action => 'hoge'
redirect_to :action => 'about', :id => id
redirect_to 'http://google.co.jp'