Friday, November 5, 2010

[Rails] non event_calendar

What am I missing here, trying to get the event_calendar plugin working
with my existing app. Have installed the plugin, which I guess is a good
start, then this...

class Booking < ActiveRecord::Base
has_event_calendar :start_at_field => 'arrival_date', :end_at_field =>
'departure_date'

Route...
map.availability_calendar '/availability_calendar/:year/:month',
:controller => 'properties',
:action => 'availability_calendar',
:requirements => {:year => /\d{4}/, :month
=> /\d{1,2}/},
:year => nil,
:month => nil

Action in controller....
def availability_calendar
@month = (params[:month] || Time.zone.now.month).to_i
@year = (params[:year] || Time.zone.now.year).to_i
@shown_month = Date.civil(@year, @month)
@event_strips = Booking.event_strips_for_month(@shown_month)
end

View .....
foo
<%= event_calendar %>

Result....
undefined local variable or method `event_calendar' for
#<ActionView::Base:0x102e77220>

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate