Created
August 1, 2011 07:14
-
-
Save robyurkowski/1117702 to your computer and use it in GitHub Desktop.
content_for :body_content_side does not show up...
This file contains hidden or 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
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 |
This file contains hidden or 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
- 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