Ignore me.
I needed a helper like this..
All good - :-), it looks Great.
module CalendarHelper
def month_link(month_date)
link_to(I18n.localize(month_date, :format => "%B"), {:month =>
month_date.month, :year => month_date.year})
end
# custom options for this calendar
def event_calendar_opts
{
:year => @year,
:month => @month,
:event_strips => @event_strips,
:month_name_text => I18n.localize(@shown_month, :format => "%B
%Y"),
:previous_month_text => "<< " +
month_link(@shown_month.last_month),
:next_month_text => month_link(@shown_month.next_month) + " >>"
}
end
def event_calendar
# args is an argument hash containing :event, :day, and :options
calendar event_calendar_opts do |args|
event = args[:event]
%(<a href="/events/#{event.id}"
title="#{h(event.name)}">#{h(event.name)}</a>)
end
end
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.