Module: TaggedEventsController
- Defined in:
- lib/tagged_events_controller.rb
Class Method Summary collapse
Instance Method Summary collapse
- #calendar_parameter_names_with_tags ⇒ Object
- #continuing_events_with_tags ⇒ Object
- #event_finder_with_tags ⇒ Object
- #tags ⇒ Object
- #url_with_tag(tag) ⇒ Object
- #url_without_tag(tag) ⇒ Object
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/tagged_events_controller.rb', line 3 def self.included(base) base.class_eval { helper_method :tags, :url_with_tag, :url_without_tag alias_method_chain :event_finder, :tags alias_method_chain :continuing_events, :tags alias_method_chain :calendar_parameter_names, :tags } end |
Instance Method Details
#calendar_parameter_names_with_tags ⇒ Object
28 29 30 |
# File 'lib/tagged_events_controller.rb', line 28 def + [:tags] end |
#continuing_events_with_tags ⇒ Object
22 23 24 25 26 |
# File 'lib/tagged_events_controller.rb', line 22 def @continuing_events = @continuing_events.() if .any? @continuing_events end |
#event_finder_with_tags ⇒ Object
16 17 18 19 20 |
# File 'lib/tagged_events_controller.rb', line 16 def ef = ef = ef.() if .any? ef end |
#tags ⇒ Object
12 13 14 |
# File 'lib/tagged_events_controller.rb', line 12 def @tags ||= Tag.from_list(params[:tags], false) || [] end |
#url_with_tag(tag) ⇒ Object
38 39 40 41 42 |
# File 'lib/tagged_events_controller.rb', line 38 def url_with_tag(tag) url_for(url_parts({ :tags => Tag.to_list( + [tag]) })) end |
#url_without_tag(tag) ⇒ Object
32 33 34 35 36 |
# File 'lib/tagged_events_controller.rb', line 32 def url_without_tag(tag) url_for(url_parts({ :tags => Tag.to_list( - [tag]) })) end |