Created
May 5, 2010 16:35
-
-
Save greenplastik/391067 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails: 3.0.0.beta3 | |
# Ruby: ruby-head | |
# from routes.rb: | |
match '/calendar(/:year/:month)', :to => 'calendar#index', :defaults => { :year => Time.zone.now.year, :month => Time.zone.now.month } | |
# from calendar_helper.rb: | |
def month_link(date) | |
link_to(I18n.localize(date, :format => "%B"), {:controller => "calendar", :action => "index", :year => date.year, :month => date.month}) | |
end | |
# the links go only to /calendar. if I manually go to /calendar/2010/03, it works (it goes to March 2010). | |
# I've even tried changing the helper to try to force but the links still go only to /calendar: | |
def month_link(date) | |
link_to(I18n.localize(date, :format => "%B"), {:controller => "calendar", :action => "index", :year => 2010, :month => 1}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment