Good notes posted by hannu
RSS feed
hannu -
February 17, 2009
4 thanks
Date_select with assert_valid_keys
If you are using date_select with assert_valid_keys you have to allow 3 parameters named field(1i), field(2i) and field(3i).
For example with field
date_select("post", "written_on")
You have to allow following fields:
params[:post].assert_valid_keys( 'written_on(1i)', 'written_on(2i)', 'written_on(3i)' )
hannu -
July 4, 2008
13 thanks
Link to same URL with different format
Use params.merge as options. Ex.
<%= link_to "RSS feed", params.merge(:format => :rss), :class => "feed_link" %>
hannu -
June 20, 2008
10 thanks
Set cache time-to-live
You can specify time-to-live for the cached item in seconds with :expires_in option.
class ListsController < ApplicationController caches_action :index, :expires_in => 1.hour end