Skip to content

Instantly share code, notes, and snippets.

@robyurkowski
Created August 1, 2011 07:14
Show Gist options
  • Save robyurkowski/1117702 to your computer and use it in GitHub Desktop.
Save robyurkowski/1117702 to your computer and use it in GitHub Desktop.
content_for :body_content_side does not show up...
class EventsController < ApplicationController
before_filter :find_all_events
before_filter :find_page
def index
# you can use meta fields from your model instead (e.g. browser_title)
# by swapping @page for @event in the line below:
present(@page)
end
def show
@event = Event.find(params[:id])
# you can use meta fields from your model instead (e.g. browser_title)
# by swapping @page for @event in the line below:
present(@page)
end
protected
def find_all_events
@events = Event.order('position ASC')
end
def find_page
@page = Page.where(:link_url => "/events").first
end
end
- content_for :body_content_title do
= @event.title
- content_for :body_content_left do
%article.event
%header
%h3= link_to @event.title, event_url(@event)
.event_box
.date_and_city
.date= l(@event.start_date, :format => :dmonthy).downcase + " - " + l(@event.end_date, :format => :dmonthy).downcase
.city= @event.location
.location= @event.city unless @event.city.blank?
.details= raw(@event.description)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment