Skip to content
Browse files

Attractions, per attraction display working

  • Loading branch information...
1 parent 3a335f2 commit 6b2324080c2b74b6763c0897509626286db09934 @chrisfleming committed with Chris Fleming
Showing with 12 additions and 4 deletions.
  1. +3 −0 app/models/attraction.rb
  2. +1 −1 app/models/page.rb
  3. +8 −3 app/views/attractions/show.html.erb
View
3 app/models/attraction.rb
@@ -1,4 +1,7 @@
class Attraction < ActiveRecord::Base
set_rgeo_factory_for_column(:latlon,
RGeo::Geographic.spherical_factory(:srid => 4326))
+
+ belongs_to :page
+
end
View
2 app/models/page.rb
@@ -1,4 +1,4 @@
class Page < ActiveRecord::Base
-
+ has_many :attractions
end
View
11 app/views/attractions/show.html.erb
@@ -1,6 +1,7 @@
<div id="centercontent" style="margin-left: 350px;">
<div id="attrleftcontent">
<div id="map" style="border:1px; width:300px; height:300px;"></div>
+ <p><%= raw(@attraction.page.sub_content) %></p>
</div>
@@ -8,9 +9,13 @@
<div id="fixedcontent">
<p id="notice"><%= notice %></p>
- <h1><%= @attraction.name %></h1>
- <p><%= @attraction.description %></p>
- <p><%= @attraction.latlong %></p>
+ <% if @attraction.page.content == nil then %>
+ <h1><%= @attraction.name %></h1>
+ <p><%= raw(@attraction.description) %></p>
+ <% else%>
+ <%= raw(@attraction.page.content) %>
+ <% end%>
+
</div>
</div>

0 comments on commit 6b23240

Please sign in to comment.
Something went wrong with that request. Please try again.